I am looking for a method of cropping uploaded images. I spent a lot of time searching the site and find plenty of good solutions if the user is providing the dimensions/location of what is to be cropped.
My pictures are mostly slips of paper taken against a darker background. Think camera phone shots of drivers licenses, credit cards, ticket stubs against a somewhat darker (but not standard) background. I am looking for a method to either before or after upload to have the my code identify what should be cropped.
In a perfect world some smarts would make a suggestion as to what to crop and give the user a chance to give it a final okay. This would allow for a less then perfect cropping algorithm.
After looking up 'trim' instead of crop based on the first answer it seems like I could possible do this with Imagemagick imagemagick.org/script/api.php
Imagemagick seems to have intefaces in PHP & Ruby. It supports a trimming of 'fuzzy' images, one in which the boarder is not consistent. The problem that I am looking for advise on is a recommendation on a graphics engine that has good logic to find the edges of the images. Is there a better engine that I should be looking at then imagemagick?


