Crop a large image into multiple smaller ones

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Crop a large image into multiple smaller ones

Post by fmw42 »

you need to specify the -quality setting for your jpg output file. IM uses a default of -quality 80. Your input image may have been at a lower quality than the outputs using the default quality of 80. You can set it lower if you want smaller jpg file sizes. Also add +repage to your command. Also put your input image right after "convert".

convert big_file -crop 120x120 -quality 50 +repage small_file.jpeg
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Crop a large image into multiple smaller ones

Post by anthony »

Jpg is not recommended as a intermediate image, only as a final image format for use on the web. If you can try and keep a copy of images in a non-lossy format like PNG (yes it is larger), or better still always try to start processing image from the original source image so ac to avoid loss of quality.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply