• Edit
  • Delete

Imagemagick Nconvert Photos Images

http://www.imagemagick.org/Usage/

Mass resize

mogrify -path small -auto-orient -sample 860x574 -compress JPEG -quality 80 *.*

mogrify -format jpg -auto-orient -strip -compress JPEG -quality 80 *.*

mogrify -format png -auto-orient -strip -resize 64x64 *.png

resize gives better quality than sample, but is slower

Make background color transparent

Simple color replacement

convert input.png -transparent white output.png

Pretty good, flood fill with fuzz percentage

convert input.png -bordercolor white -border 1x1 -alpha set -channel RGBA -fuzz 5% -fill none -floodfill +0+0 white -shave 1x1 output.png

For multiple images

mogrify -path modified_images -format png -bordercolor white -border 1x1 -alpha set -channel RGBA -fuzz 5% -fill none -floodfill +0+0 white -shave 1x1 *.jpg

Useful Addition: -trim to remove unnecessary border

Strip color profile information

mogrify -format png -strip *.png