Login  Register

filling an image

Posted by Alfredo Ok on Aug 06, 2005; 8:07pm
URL: http://imagej.273.s1.nabble.com/filling-an-image-tp3705081.html

This might be a stupid question, but does anyone know how to fill an image
with a single color, such as black, or else to clear an existing image's
pixel values so that it's blank? I'm trying to open an existing image,
erase what's already drawn on it, and then redraw it with what I want, but
so far the erasing part has been troublesome.

I realize that the ImageProcessor class has a function fill(), but when I
do something like this:

ip.setValue(0);
ip.fill();

it doesn't work!! I even tried adding imp.updateAndDraw(); to see if that
would change anything, but it didn't. Is there any other way to accomplish
this, or am I doing something wrong?

Thanks!!
  -alfredo