How we can handle transparency when resizing an GIF image in JAVA

M

manjula

Hi friends,

I'm working on a image processing program which do resizing JPG, PNG ,
and GIF images.
I did the PNG and JPG image resizing part without any problem.
but when i tried to resize transparent GIF images (animated) i still
have a big problem.
I can resize transparent GIF image but when i resized it , some parts
of the GIF image also become transparent addition to real transparent
ares.
I think the in GIF transparency,
we first apply a back ground color
then draw image on it and set all the pixel of that background color
to transparent.


Then the problem is if the real image also has pixels with the same
background(transparent) color. then they also disappeared due to set
that color transparent.


That's my idea.

Can u give any idea about how to overcome this?
also I need some GIFENcoders, sometimes that may be the problem.

Thank u verymuch.
regards,

Manjula
 
R

Roedy Green

Then the problem is if the real image also has pixels with the same
background(transparent) color. then they also disappeared due to set
that color transparent.

That is a flaw in your original GIF image. You should select a colour
than is not used anywhere in the image to represent your transparent
background. You must manually make the distinction with a drawing
tool. Failing that your transparent colour must be represented by a
colour number that does not appear naturally in the image.

You might use a tool like Paint Shop Pro to clean this up, then you
should be able to manipulate your images.

You could write a program to do an approximate cleanup that would find
tiny islands of background and convert them to some other colour, but
leave big areas of it alone. That would likely be a useful painting
tool. I have not seen it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top