Take an ID photo taken with a white background.
I want to programmatically remove the white background (keep non surrounding white from the photo).
After a long and boring search (in French, then in English) I found nothing (everything I found was using Photoshop, Gimp, some web sites, etc.).
Back 25 years ago, I had an HyperCard stack who provide this function, but that was 25 years ago and I never saw (watched) the code, then.
All clues, ideas, links to code, etc. is welcome.
The idea is to make a search, line after line (left to right / top to bottom of the image), for the first non white pixel: easy to search for the first pixel (from left to right), but I do not know how to do the same for the last non white pixel.
Think at a circle: once you found the first non white pixel, how can I know where is the last non white pixel o the other side of the circle ?
As far as I recall, the found pixel location are stored in an array of x,y and then later used as parameter in a DrawPolygon.