T
Tim
I want to read a .png image from a file, replace a color with a new color,
and write it back to a .png file.
I've managed to read the file into a BufferedImage. I've got a PixelGrabber
to look at the pixels, identify those of the old color, and replace them
with the new color, leaving me with an int[] of the pixels I want.
How do I modify write the modified pixels out to a .png file? I don't care
if I overwrite the original image or write to a new one.
No matter how I try to do it I end up with a new file that is identical to
the original, even though I can tell my code is correctly identifying the
pixels I want to change.
Please help,
Tim
and write it back to a .png file.
I've managed to read the file into a BufferedImage. I've got a PixelGrabber
to look at the pixels, identify those of the old color, and replace them
with the new color, leaving me with an int[] of the pixels I want.
How do I modify write the modified pixels out to a .png file? I don't care
if I overwrite the original image or write to a new one.
No matter how I try to do it I end up with a new file that is identical to
the original, even though I can tell my code is correctly identifying the
pixels I want to change.
Please help,
Tim