can't seem to trim/autocrop an 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
Dreamscape
Posts: 2
Joined: 2012-11-26T05:18:43-07:00
Authentication code: 6789

can't seem to trim/autocrop an image

Post by Dreamscape »

Hello,

I want to trim/autocrop a picture, but whatever I do, I cannot find a way to do this.
I used the trim with the fuzz option, but no sucsses.

I used the line
convert -trim -fuzz "40%" in.jpg out.tif
with different values for fuzz, but it does nothing.

Can anybody help me?

Here is the picture. I used a blank page for this sample.
Image
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: can't seem to trim/autocrop an image

Post by Bonzo »

Try:

Code: Select all

convert in.jpg -fuzz 40% -trim out.tif
Dreamscape
Posts: 2
Joined: 2012-11-26T05:18:43-07:00
Authentication code: 6789

Re: can't seem to trim/autocrop an image

Post by Dreamscape »

Hello,

Thanks for your response.

It didn't work, i've tried "convert in.tif -fuzz 80% -trim out.tif", but I still get a black border on the left. And when I try it with writing on the page, it doesn't trim it at all.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: can't seem to trim/autocrop an image

Post by fmw42 »

The following works for me on IM 6.8.0.7 Q16 Mac OSX Snow Leopard. Your problem is that your background is not solid black and has some gray stripes in it.


convert ehbuht.jpg -strip -fuzz 80% -trim +repage result.jpg
Post Reply