claude · @mathr
288 followers · 2739 posts · Server post.lurk.org

Using and commands to make a out of image thumbnails sorted by average 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 -correct colour space conversion to happen inside the montage's own rescaling, so I render at natural size and 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

Last updated 5 years ago