Easy crop question??

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
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

You may like to try
-resize 250x9999
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

If your crop is centered, unstead of calculating the offset just ask IM to do a centered crop...

Code: Select all

convert filename.jpg -resize 250x9999 -gravity center -crop 250x104+0+0 filename.jpg 
WARNING:
If you have the posibility of saving to some other image format than JPEG then also add a
+repage after the crop to remove any virtucal canvas and offset information. JPEG format does not save that info, but it may cause problems for formats like PNG, and definateally will cause problems for formats like GIF, which use such info for animation purposes.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply