views:

215

answers:

1

I have a bunch of images that have a single color overlay with some text on it positioned at the bottom. Not all images have the overlay and the overlay is not of the same height on every picture.

I am looking for a way to detect the overlay rectangle, and crop only the part of the image without it.

Trim seems the logical way to go, but the text on the overlay makes trim remove only the part below the text.

Any ideas would be welcome.

Thanks!

+1  A: 

Make a copy of the image and crop it to just the left-most 5 pixels (assuming that there's some left margin to the text), trim and find out the new height. Then use the height of that trim to crop the original.

Lou Franco
Nice one, now I'm hoping the margins are uniform across all docs. Thanks!
code_burgar
Actually, this doesn't work for images that have a single-color background. I have an idea how to fix that though.
code_burgar
No dice with that idea. Any more ideas Lou? Thanks!
code_burgar
Can you put an example image somewhere? imgur.com?
Lou Franco