I just started working with Imagemagick today.
I understand some of the basics and I have run some successful tests.
However, I have not yet figured out things for the main reason that I am working with Imagemagick.
I have a large number of jpg files that are being generated by a purchased software package.
I would like to trim off 1 inch from the bottom of each image and 1/2 inch from both the left and right sides of each image.
I would guess that this is easy to do with Imagemagick, but I have not figured it out yet.
It would be much appreciated it some one would post an example of how to do this.
Thanks,
Brad
How to Remove 1 inch from bottom & 1/2 inch from each side
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: How to Remove 1 inch from bottom & 1/2 inch from each s
You would need to calculate the 'shave' to perform, based on the images resolution.
In IMv6 you will need to do that externally in a shell or DOS script wrapper.
IMv7 (still in alpha development) can do this more directly using %[fx:..] escapes in the operator option arguments.
I am working to allow the same global use of percent escapes in setting options to make it even more useful.
In IMv6 you will need to do that externally in a shell or DOS script wrapper.
IMv7 (still in alpha development) can do this more directly using %[fx:..] escapes in the operator option arguments.
I am working to allow the same global use of percent escapes in setting options to make it even more useful.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: How to Remove 1 inch from bottom & 1/2 inch from each s
You could shave as Anthony says or crop. But images work in pixels and not inches so you will either need to experiment or calculate the amounts based to remove based on the DPI as Anthony also says.
Crop = 300x300+25+0 the final image will be 300px x 300px and 25px in from the left hand side and 0 from the top
If you check out my site I have an example of most of the options using php but you can see an example and the related code you can modify.
You can also see information about all the operators here: http://www.imagemagick.org/script/comma ... eonsb3v9q6
Crop = 300x300+25+0 the final image will be 300px x 300px and 25px in from the left hand side and 0 from the top
Code: Select all
convert input -crop 300x300+25+25 +repage output
You can also see information about all the operators here: http://www.imagemagick.org/script/comma ... eonsb3v9q6
Re: How to Remove 1 inch from bottom & 1/2 inch from each s
Thanks for the help, I really appreciate it.
I now have a working example of what I am trying to do.
Brad
I now have a working example of what I am trying to do.
Brad