This site requires JavaScript, please enable it in your browser!
Greenfoot back
Pointifix
Pointifix wrote ...

2014/3/10

Change Color of an Image

1
2
Pointifix Pointifix

2014/3/10

#
Hey Guys! I wanted to ask if theres any way to change the color of an whole image, so if i have an image thats gray and i want the gray to get blue or red or green without redrawing the whole form on that image?
bourne bourne

2014/3/10

#
Like from code, you could loop through each pixel, check if it is the color to be replaced, and if so set that pixel to new color. There might be some image software out there that does this. But really is trivial to code.
Pointifix Pointifix

2014/3/10

#
i already thought over this solution but isnt this very cpu intensive?
bourne bourne

2014/3/10

#
Are you expecting to do it repeatedly like every act cycle?
Pointifix Pointifix

2014/3/10

#
jap, every act cycle like 20 times ;) or more
bourne bourne

2014/3/10

#
How big are these images? And I did a Google search and found this: http://docs.oracle.com/javase/6/docs/api/java/awt/image/RGBImageFilter.html Which I will be reading more to see what can be done with it
danpost danpost

2014/3/10

#
Pointifix wrote...
jap, every act cycle like 20 times ;) or more
Do you mean '20 times per act cycle' (which would be impossible without the use of delays) or 'the image will be changing colors about 20 or more times in a row, one change per act'? If the latter, I would have the images of all colors pre-made with references in fields and just set the image accordingly each cycle.
Pointifix Pointifix

2014/3/10

#
its an editor with cells the cells can be changen from lets say 5 px to 100 px or something so the pictures can be 5*5 or 100*100, if the screen is 500*500 big, there is with cell size of 50 space for 10*10 pictures so there can be many of these each cycle
Pointifix Pointifix

2014/3/10

#
the image should not be drawn each cycle 20 times by the way just changed to draw on different places
danpost danpost

2014/3/10

#
Will the sum of these cells create a multi-colored grid? or will all cells have the same color at any given time? Is each cell an Actor object?
Pointifix Pointifix

2014/3/10

#
multi colored nope all in my world class no actor
danpost danpost

2014/3/10

#
With your last post, I would have to say I totally mis-interpreted what you are trying to do. Well, previous to last.
Pointifix Pointifix

2014/3/10

#
this is the way it looks like at the moment: http://www.fotos-hochladen.net/view/unbenanntgur9oykw61.jpg but the objects (which will get more different shapes) are all gray but they should get colored
Pointifix Pointifix

2014/3/10

#
i mean it should be a feature, i could make it only gray too but i thought this will go to be boring to look at
bourne bourne

2014/3/10

#
What changes their color? What event takes place that they need to change their color? Are they really changing colors each act cycle, like fading from one color to another or what?
There are more replies on the next page.
1
2