code for cropping PNG images

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
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Post by glennrp » 2006-07-17T14:44:08-07:00

Code: Select all

convert input.png -crop 100x100 scene%04d.png

User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony » 2006-07-17T16:44:44-07:00

For a specific rectangle from a LOT of images
say a 100x100 pixel sub-image positioned at +50+50 try...

Code: Select all

   convert image image image image.... \
              -crop  100x100+50+50   subimages_%03d.png
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Post Reply