tint() + blend()
in
Core Library Questions
•
1 year ago
My observations seem to indicate that tint() has no effect on images drawn with blend() (Processing 2.0b3). Is this correct?
If so, what is the most efficient way to alter the transparency of an image drawn with blend() (I am using tint to modify alpha only)?
Thanks,
J
Edit: Example (with color, not alpha):
- PImage img = createImage(64, 64, RGB);
- void setup () {
- size(200, 200);
- for (int n = 0; n < img.width; ++ n) {
- img.set(n, n, 0xFFFFFFFF);
- img.set(64 - n, n, 0xFFFFFFFF);
- }
- }
- void draw () {
- background(0, 0, 255);
- noTint();
- image(img, 10, 10);
- tint(0, 255, 0);
- image(img, 100, 10);
- noTint();
- blend(img, 0, 0, img.width, img.height, 10, 100, img.width, img.height, ADD);
- tint(0, 255, 0);
- blend(img, 0, 0, img.width, img.height, 100, 100, img.width, img.height, ADD);
- }
The result I expect is that the bottom right X would be cyan on a blue background (white X tinted green then added to blue). What I see is a white X on a blue background.
1