Using #ImageMagick #montage #identify and #convert commands to make a #gradient out of image thumbnails sorted by average #sRGB #grey level:
```
montage -tile ${COLUMNS}x${ROWS} -geometry ${TILEWIDTH}x${TILEHEIGHT}+0+0 $( identify -colorspace RGB -format "%[fx:mean] %[filename]\n" in-*.png | sort -nr | cut -d\ -f 2 ) out.png &&
convert tmp.png -colorspace RGB -geometry ${WIDTH}x${HEIGHT} -colorspace sRGB out.png
```
I didn't yet figure out how to get the #gamma-correct colour space conversion to happen inside the montage's own rescaling, so I render at natural size and #downscale with convert afterwards.
The last image is the good result, the other two are gamma-incorrect, thus they appear too dark on screen (and presumably print too).
#imagemagick #montage #identify #convert #gradient #srgb #grey #gamma #downscale