Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
manjula - 30 Oct 2007 09:14 GMT
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
Roedy Green - 30 Oct 2007 17:26 GMT
>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.
Signature

Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.