Page 1 of 1

crop black border

Posted: 2008-10-16T04:10:25-07:00
by lele-brz
Hi,
I'm new to ImageMagick, I'm usign this (actually RMagick) to generate thumbnails.
I can do that very easily but I would like to trim black borders (letterbox) if present in the source jpg.
Is there a function for this, or a way to do that?
I could access pixel by pixel and understand where to crop, but I don't know how to do that.
Thanks in advance

bye

Re: crop black border

Posted: 2008-10-16T05:00:05-07:00
by Bonzo
I do not know about Rmagick but -trim should do it.
http://www.imagemagick.org/script/comma ... s.php#trim

Re: crop black border

Posted: 2008-10-16T05:19:02-07:00
by lele-brz
Thanks, I'll try that.
What I don't know is what would happen if I have a black image with just a writing in the center.

Re: crop black border

Posted: 2008-10-16T22:25:00-07:00
by anthony
it will crop the image so the text is all touching the borders of the resulting image.