Compdigitec Labs

« | Home | »

ImageMagick snippet: batch crop, dither, and guillotine

By admin | November 12, 2020

# Create output dirs
mkdir -p cropped dithered output
rm cropped/*.png dithered/*.png output/*.png

# Crop (3000x2000 at position 200, 200)
mogrify -crop 3000x2000+200+200 -path ./cropped *.png

# Dither (to indexed colours)
mogrify +dither -colors 4 -path ./dithered cropped/*.png

# Guillotine
mogrify -crop 2x1@ +repage -path ./output dithered/*.png

If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!

Topics: Linux | No Comments »