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 / September 2007

Tip: Looking for answers? Try searching our database.

Changing colors of a gif image

Thread view: 
Todd - 25 Sep 2007 22:56 GMT
Hello again,

I got the .gif file that I have to be transparent in the correct
locations.  Now, I would like to change the colors of the remaining
pixels based upon an input color.

I have looked at ConvolveColorOp, but don't understand how to define a
ColorSpace to convert, say black to blue.  Maybe I am missing
something quite simple, but ...

I have looked at RescaleOp, but get an error stating "Rescaling cannot
be performed on an indexed image."  I was probably on the wrong path
here anyway - I set all the scales to zero and then used the RGB
values of the input color as the offsets, me thinks that this will
give a single colored block.

I have spent way too many hours trying to decipher the Java tutorials,
which are surprisingly sparse when it comes to ConvolveColorOp, so I
am asking for help from you guys.

Any thoughts on how to change pixel colors within a .gif file are
appreciated,
Todd
Knute Johnson - 25 Sep 2007 23:44 GMT
> Hello again,
>
[quoted text clipped - 19 lines]
> appreciated,
> Todd

There is no ConvolveColorOp.  There is a ConvolveOp and a
ColorConvertOp.  Neither of which are particularly suited to what you
want to do.

Load your GIF image into a BufferedImage object and modify the pixels
directly and then either display it or write it to permanent storage.

Signature

Knute Johnson
email s/nospam/knute/

Andrew Thompson - 26 Sep 2007 00:14 GMT
...
> I got the .gif file that I have to be transparent in the correct
> locations.  

If this is related to the 'upwards/downwards
pointing triangle' type graphics you mentioned
on another thread, it might be a better strategy
altogether to render the graphic on the fly, using
a custom component, rather than use images at all.

(I had only thought of that after posting the
earlier messages.)

Andrew T.


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.