Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

painting an image  RSS feed

 
Igor Zeta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to have an image painted having in input the same image.
Any suggestion?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I don't understand what you are trying to do? Perhaps some more detail would help...
 
Igor Zeta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've to change colour of five images.
I've already setted up the chain that
get the user able to choose the colour
and generate the output with the desired
colours of other html elements.
Now I need to change the colour of gif images.
In other words I need to load in memory a gif image change the colour and write down to the file system.
I've come through sun site and I've found
something about MediaTracker but I'm not sure it's what I'm looking for...
I've seen something about JAI...
Some example?Some suggestion?
thanks
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is very similiar to the problem in this post... I am using .png files instead of .gif files because of the unisys patent problem that means the core JDK has GIF reading functionality, but not GIF writing...

There is more information on this topic on this geocities homepage.
 
Igor Zeta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok,
very usefull post.
Now I read, modify the colour and write to a gif
format.
But, Do you know why some gif I'm not able to modify and other yes.
I've been finding that it's a problem related to the image palette.Or not?
Any suggestion?
thanks!
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's probably a problem with the GIF Format... I know there are a couple of different types of gif formats (like 89a, etc.). Also, I've run into lots of problems before with animated gif files... I think these are formatted quite differently from normal gif files...
 
Igor Zeta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now, looking for some problems related to palettes I've decided to work with png that can store more colours occuping low memory size.
Have you some snippet of code for write down to
a png file format from an Image?
In few words using your code...
thanks!
[ March 24, 2003: Message edited by: Igor Zeta ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using JDK 1.4 the easiest way is the ImageIO class...
 
Igor Zeta
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok,
now I do all that I wanted.
I've added the options for chosing colors from a JColorChooser,more you have to pay attention to the starting image color(currentColor var) that you must define in the code.
I give you the entire modified code.

[ April 28, 2003: Message edited by: Igor Zeta ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!