I have a block of product images we received from a customer. Each product image is a picture of something and it was taken with a white background. I would like to crop all the surrounding parts of the image but leave only the product in the middle. Is this possible?
As an example: http://www.5dnet.de/media/catalog/product/d/r/dress_shoes_5.jpg
I don't want all white pixels removed, however I do want the image cropped so that the top-most row of pixels contains one non-white pixel, the left-most vertical row of pixels contains one non-white pixel, bottom-most horizontal row of pixels contains one non-white pixel, etc.
Code in C# or VB.net would be appreciated.
Thanks, Kyle
Edit: If anyone would like source code for this, I have posted my solution online here: http://fitnessconnections.com/blog/remove-surrounding-white-space-from-an-image/