i can not trim this kind of image

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
magick
Site Admin
Posts: 11062
Joined: 2003-05-31T11:32:55-07:00

Post by magick » 2006-06-25T09:38:14-07:00

Try adding -fuzz 15% to your command line. Fuzz permits close colors to match along with your target color.

el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Post by el_supremo » 2006-06-25T10:02:36-07:00

The fuzz option won't help with this image. If you magnify it with an image viewer you will find that there is a margin along the top and left sides of the image that is two pixels wide consisting of various shades of grey pixels.

This is a screen grab of the top left corner of the image (I used Paint Shop Pro).
http://members.shaw.ca/saskbirder/newsletter_mag.png

I think trim will work if you first crop that margin out of the image.

Best Wishes
Pete

User avatar
magick
Site Admin
Posts: 11062
Joined: 2003-05-31T11:32:55-07:00

Post by magick » 2006-06-25T10:51:41-07:00

You could also try -trim twice (e.g. -fuzz 15% -trim -trim).

el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Post by el_supremo » 2006-06-25T11:26:36-07:00

I've played a bit with cropping and trimming that image and the margins are a bit more awkward than I thought.
In order for trim to work you have to crop a two pixel margin off the top, 5 pixels off the left margin and 5 off the bottom margin and then trim (with a fuzz of 15) reduces the image to 899x2269 from its original 982x4000.

Best Wishes
Pete

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

Post by anthony » 2006-06-26T20:20:27-07:00

for more information on -trim see
http://www.cit.gu.edu.au/~anthony/graph ... crop/#trim

This includes fuzzy trims, trims with a specific color, and trim ignoring small features.

If anyone likes to add other techniques, please mail me.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Post Reply