Working with pixels: alpha values?
in
Programming Questions
•
1 year ago
Hi, I'm new to Processing. I'm going through the tutorials, and then trying to do different things with the base principles in order to test my knowledge. I've run into a problem I was hoping someone would help me with.
and specifically this part:
I wanted to make my own image filter. I understood the principles of doing that with brightness values, but then I wanted to make the same with with alpha values and I hit a brick wall.
I loaded an image from a file, took the pixel information and created a new image object. Displaying the new image works. The brightness filter from the tutorial works. Trying to change the alpha values on a per-pixel did not work. Just to make sure, I used tint() to adjust the alpha on my image object instead of the individual pixels. It did worked.
So it looks to me that:
pixels[i] = color(255, 102, 204);
Would seem correct, but then adding a fourth value:
pixels[i] = color(255, 102, 204, 127);
Did nothing at all. I did some reading, and I'm getting the impression that pixels[] simply won't take alpha values. Is this a correct assumption? Or am I screwing up royally?
1