Improved Trim/Border Removal Command?
Posted: 2007-02-02T09:34:07-07:00
I have been writing a program in Magick++ that loads up several images and does processing on them. The problem is that some of the images have borders (white, black and everything in between) and those borders make the processing that I am doing useless.
I investigated the trim command, but it does not seem to be doing anything for a large number of my images - perhaps because of subtle color variations resulting from JPEG compression?
Here is an example image that I found on flickr It has a large white border:
http://farm1.static.flickr.com/39/10224 ... c01d2d.jpg
I ran it through the Magick Studio (http://studio.webbyland.com/MagickStudi ... Studio.cgi) trim command several times but the image never changed.
I noticed that the MagickWand C Library appears to have a trim command that allows for a level of color tolerance. Are there any plans to port this command into other places in ImageMagick, or is there a simple way I can simulate this command in my own code that someone knows of?
I investigated the trim command, but it does not seem to be doing anything for a large number of my images - perhaps because of subtle color variations resulting from JPEG compression?
Here is an example image that I found on flickr It has a large white border:
http://farm1.static.flickr.com/39/10224 ... c01d2d.jpg
I ran it through the Magick Studio (http://studio.webbyland.com/MagickStudi ... Studio.cgi) trim command several times but the image never changed.
I noticed that the MagickWand C Library appears to have a trim command that allows for a level of color tolerance. Are there any plans to port this command into other places in ImageMagick, or is there a simple way I can simulate this command in my own code that someone knows of?