ImageMagick: scale JPEG image with a maximum file-size

To restrict the resulting image to a maximum file size, you can use the commandline parameter -define jpeg:extent=max_value, like this: convert original.jpeg -define jpeg:extent=300kb output.jpg convert original.jpeg -define jpeg:extent=300kb -scale 50% output.jpg convert original.jpeg -define jpeg:extent=300kb […other options…] output.jpg Note, this will not always work to match the exact size you wanted. You may have … Read more

What is the difference between ImageMagick and GraphicsMagick?

As with many things in life, different people have different ideas about what is best. If you ask a landscape photographer who wanders around in the rain in Scotland’s mountains which is the best camera in the world, he’s going to tell you a light-weight, weather-sealed camera. Ask a studio photographer, and he’ll tell you … Read more

How do I crop an animated gif using ImageMagick?

convert input.gif -coalesce -repage 0x0 -crop WxH+X+Y +repage output.gif Animated gifs are often optimised to save space, but imagemagick doesn’t seem to consider this when applying the crop command and treats each frame individually. -coalesce rebuilds the full frames. Other commands will take into consideration the offset information supplied in the original gif, so you … Read more