Image Eraser algorithm?
Posted on 1997-10-22
Hi. I am trying to learn Java. I am attempting to write an image processing application. I want to be able to dynamically erase selected areas of a .gif or .jpg image with the drag of the mouse. So far, I have been able to make the entire image transparent in one fell swoop using an image consumer (Java's PixelGrabber class )to place all the image's pixels into an array and then recreating and filtering each pixel with an image producer (MemoryImageSource class).
I have tried placing the relevant "make transparent" code inside the mousedrag event handler method with no luck. What am I overlooking? Please does anyone know of an algorithm that does this sort of thing? I'm not asking for 'working code' - that would take the fun out of it for me. Just a relatively self-explanatory algorithm would be most appreciated.