I'm sure this is a simple yes/no answer but can you apply a tint to a single PImage object instead of the entire stage? and if so what's the best way of doing that?
What's the best way to mask part of a PImage from being changed?
For example, say I have a PImage object of a black and white house. The house itself is white and the windows/doors are black on the image. Ideally I would like to change the color of just the white section without affecting the black areas, however since it is all one object accomplishing this is tough (at least for a processing newbie like me).
Is there an easy way to do this?
My initial thought was to loop over the pixels in the image and if if they aren't black then change them, otherwise do not. Is this the usual way an effect like this is accomplished? Thanks!
What's the best way to change the hue of a PImage object?
Basically the stage has a background on it and on top of the background are a number of smaller PImage objects. I'm trying to be able to dynamically change the color of the overlaying PImage, however this is done based on the change in the user's mouse location (moving along the x axis changes hue, the y axis changes saturation). There doesn't seem to be a way to fill the PImage object with a solid color based on the old hue before the mouse moved.
Basically I'm trying to do this (if it were possible):
PImage img = (some image);
public void change(PImage img, int x_dif, int y_dif){
img.hue += x_dif;
img.saturation += y_dif;
}
Is there an easy way to do this? I've already set the color mode of the document up to HSB and so forth. I looked into looping through all the pixels but its just an integer array which I'd assume refers to the hue, and therefore doesn't allow changes to saturation as well. Any help would be greatly appreciated, thanks!