Beware of Transparent Pixels
adriancourreges.com
Beware of Transparent Pixels
1–10 of 97 posts
Re: Beware of Transparent Pixels
#2I don't understand this. When I make transparency I don't use any color? I use the Eraser tool or Ctrl-X, not a color with 0 opacity.
Re: Beware of Transparent Pixels
#3> pay attention to what color you put inside the transparent pixels I don't understand this. When I make transparency I don't use any color? I use the Eraser tool or Ctrl-X, not a color with 0 opacity.
Here is some information for Photoshop and a plugin you can use:
https://graphicdesign.stackexchange.com/questions/63783/how-...
Re: Beware of Transparent Pixels
#4Re: Beware of Transparent Pixels
#5> pay attention to what color you put inside the transparent pixels I don't understand this. When I make transparency I don't use any color? I use the Eraser tool or Ctrl-X, not a color with 0 opacity.
If you inspect the image in a full-featured editor like Photoshop or GIMP, you can inspect the channels individually or remove the transparency entirely to see this fact.
I think with most GUI programs, the eraser and cut tool will leave color as what it was before it became transparent.
EDIT: saurik has a good point that I forgot about -- many editors may actually throw the colors away when you export unless you ask them not to.
Re: Beware of Transparent Pixels
#6> pay attention to what color you put inside the transparent pixels I don't understand this. When I make transparency I don't use any color? I use the Eraser tool or Ctrl-X, not a color with 0 opacity.
As the author mentions, certain resampling algorithms might be naive or plain ignorant about how to resample images with potentially transparent pixels. Should transparent pixels not count to the final pixel? Should all pixels be averaged? Should the output pixel be the median or mode value? If the image is being resampled to 1/3 its size the resampling can be very cheap if only the middle of the 3x3 pixel cluster is selected as the output value.
Re: Beware of Transparent Pixels
#7> pay attention to what color you put inside the transparent pixels I don't understand this. When I make transparency I don't use any color? I use the Eraser tool or Ctrl-X, not a color with 0 opacity.
Say you have two adjacent pixels using floating point RGBA values of (0,0,0,0) and (1,1,1,1), and you apply it to a 3-d shape. Because of the rasterization algorithm, you will be sampling weighted averages of the two pixels, either because you're scaling up and need to interpolate, or because you're scaling down and need to average.
The average of (0,0,0,0) (fully transparent) and (1,1,1,1) (opaque white) is (0.5,0.5,0.5,0.5), a half transparent gray. But you'd intuitively expect (1,1,1,0.5), half transparent white. This is the essence of the problem. The fix is to make sure that your transparent pixel was (1,1,1,0) and not (0,0,0,0).
Re: Beware of Transparent Pixels
#8Re: Beware of Transparent Pixels
#9Wish the article was more clear as to why this happens. Let me elucidate: this happens because, per the PNG standard[0], 0-alpha pixels have their color technically undefined. This means that image editors can use these values (e.g. XX XX XX 00) for whatever -- generally some way of optimizing, or, more often than not, just garbage. There are ways to get around this by using an actual alpha channel in Photoshop[1], or by using certain flags in imagemagick[2].
[0] https://www.w3.org/TR/PNG/
[1] https://feedback.photoshop.com/photoshop_family/topics/png-t...
[2] http://www.imagemagick.org/discourse-server/viewtopic.php?t=...