Hello,
I have a picture with a white background. I would like to find the minimal rectangle around the picture, more precisely the rectangle must start at the first non white pixels.
Here is a way to do that with imagemagick ?
How to automatically crop a picture
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How to automatically crop a picture
I don't think -trim will guarantee that the rectangle starts with the first non-white pixel. Say you have a black circle in a white background. Then -trim will have a minimum size image that has white in the top left corner, but has back at the center of the sides of the circle.
Please clarify your request further. Or present an example (diagram or image) that you think shows what you want!
You may also want to look at my scripts, autotrim and trimmer. see link below
Please clarify your request further. Or present an example (diagram or image) that you think shows what you want!
You may also want to look at my scripts, autotrim and trimmer. see link below