# Transparent PNG texture tint not working

**URL:** <https://discourse.processing.org/t/transparent-png-texture-tint-not-working/9122>\
**Category:** Coding Questions\
**Created:** [March 8, 2019, 7:23pm UTC](https://discourse.processing.org/t/transparent-png-texture-tint-not-working/9122 "2019-03-08T19:23:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjespers](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@sjespers](https://discourse.processing.org/u/sjespers)\
**Post date:** [March 8, 2019, 7:23pm UTC](https://discourse.processing.org/t/transparent-png-texture-tint-not-working/9122/1 "2019-03-08T19:23:23Z")

</div>

Hello!

Anyone have any idea why some transparent PNGs don’t seem to respond to tint?

Example:

```auto
size(200, 200, P3D);
noStroke();
PImage img = loadImage("https://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Apple_logo_black.svg/100px-Apple_logo_black.svg.png");
img.resize(100,100);
PShape shp = createShape();
shp.beginShape();
shp.textureMode(IMAGE);
shp.tint(255,0,0,255);
shp.texture(img);
shp.vertex(0, 0, 0, 0);
shp.vertex(100,0, 100, 0);
shp.vertex(100, 100, 100, 100);
shp.vertex(0,100, 0, 100);
shp.endShape();
shape(shp, 0,0);

```

I expect this to come out red… but it doesn’t and I can’t seem to figure out why…

---

<div class="post-metadata">

**Author:** ![sjespers](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@sjespers](https://discourse.processing.org/u/sjespers)\
**Post date:** [March 8, 2019, 10:14pm UTC](https://discourse.processing.org/t/transparent-png-texture-tint-not-working/9122/2 "2019-03-08T22:14:53Z")

</div>

The alpha value works but not the color value.

---

<div class="post-metadata">

**Author:** ![cras](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@cras](https://discourse.processing.org/u/cras)\
**Post date:** [March 8, 2019, 10:32pm UTC](https://discourse.processing.org/t/transparent-png-texture-tint-not-working/9122/3 "2019-03-08T22:32:51Z")

</div>

Hi, sjespers

I think that tinting something that is completely black wouldn’t have any effect. If you look at the first image in the reference: [https://processing.org/reference/tint\_.html](https://processing.org/reference/tint_.html)  
you can see that the black part of the image is still black, while the rest becomes blue.

---

<div class="post-metadata">

**Author:** ![sjespers](https://avatars.discourse-cdn.com/v4/letter/s/ec9cab/32.png) [@sjespers](https://discourse.processing.org/u/sjespers)\
**Post date:** [March 8, 2019, 10:40pm UTC](https://discourse.processing.org/t/transparent-png-texture-tint-not-working/9122/4 "2019-03-08T22:40:57Z")

</div>

Fair enough… But what about this:

```auto
size(200, 200, P2D);
noStroke();
PImage img = loadImage("https://2mbg6fgb1kl380gtk22pbxgw-wpengine.netdna-ssl.com/wp-content/themes/brexitcentral/images/featured-overlay.png", "PNG");
img.resize(100,100);
PShape shp = createShape();
shp.beginShape();
shp.textureMode(IMAGE);
shp.tint(255,0,0,128);
shp.texture(img);
shp.vertex(0, 0, 0, 0);
shp.vertex(100,0, 100, 0);
shp.vertex(100, 100, 100, 100);
shp.vertex(0,100, 0, 100);
shp.endShape();
shape(shp, 0,0);

```

---

<div class="post-metadata">

**Author:** ![cras](https://avatars.discourse-cdn.com/v4/letter/c/bcef8e/32.png) [@cras](https://discourse.processing.org/u/cras)\
**Post date:** [March 8, 2019, 10:48pm UTC](https://discourse.processing.org/t/transparent-png-texture-tint-not-working/9122/5 "2019-03-08T22:48:47Z")

</div>

That’s actually the exact same issue. The new image is just a gradient from black to transparent, so it doesn’t contain any pixels that can be tinted.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 11, 2019, 12:00am UTC](https://discourse.processing.org/t/transparent-png-texture-tint-not-working/9122/6 "2019-03-11T00:00:52Z")

</div>

It seems like you might want to check out `blendMode()` or the older `blend()` in order to convert blacks into something else ( like white ). There are lots of ways to use blendModes to achieve such a transfer. Then you can tint() the light / inverted / subtracted colors.

[https://processing.org/reference/blendMode\_.html](https://processing.org/reference/blendMode_.html)  
[https://processing.org/reference/blend\_.html](https://processing.org/reference/blend_.html)
