Hi
I have images with white background and a clipping path - see example here: http://resources.jysk.com/getimage/pm.l ... 1/WEB/1001
I would like to crop the photo so the closet in the photo takes up as much space as possible. It must be the clipping-path that defines the left, right, top, bottom coordinate for the crop.
Is this possible in a simple way with ImageMagick?
Best regards,
Benny Pedersen
Crop to clipping path
Re: Crop to clipping path
Out of curiosity:
is this even possible at all with IM?
because all command lines i have seen so far are using the path information to change the color outside and trim to actually shrink the image.
But to use the clipping path so that the canvas of the new image touches the outside of the path, and not to change pixels outside the clipping path, that are still visible - i would not know how to do it
is this even possible at all with IM?
because all command lines i have seen so far are using the path information to change the color outside and trim to actually shrink the image.
But to use the clipping path so that the canvas of the new image touches the outside of the path, and not to change pixels outside the clipping path, that are still visible - i would not know how to do it
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Crop to clipping path
I would clip the image, or at least a copy or trash image. then use -trim and output the crop parameters the trim came up with.
after that you can use those parameters to crop the original image.
It is similar to a sort of 'fuzzy trim' technique for noisy images.
http://www.imagemagick.org/Usage/crop/#trim_blur
after that you can use those parameters to crop the original image.
It is similar to a sort of 'fuzzy trim' technique for noisy images.
http://www.imagemagick.org/Usage/crop/#trim_blur
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/