Question Layers in PNG?

Oblivion77

Honorable
Jul 6, 2018
238
2
10,585
Hello everyone

I have some questions regarding PNG.

1) Is a PNG picture one layer and a background OR only one layer with background and everything merged together?

I have opened one of my PNG-files using TweakPNG.
2) If there is no tRNS chunk in the display window of TweakPNG, and the bit depth of the PNG-file is 24, is it then correct, that there is no transparency in the picture?

3)I there is no BKGD chunk in the display window of TweakPNG, is it then correct, that there is no background in the picture?
And that the picture is only one layer?

This has been my primary souce of information: https://www.w3.org/TR/2003/REC-PNG-20031110/

What does this mean:
A) “The more opaque a pixel,the more it hides the background against which the image is presented”.
B) 3.1.13 composite (verb) to form an imageby merging a foreground image and a background image, using transparency information to determine where and to what extent the background should be visible. The foreground image is said to be "composited against" the background.

Thanks in advance for answering

Best regards
Emil
 
Well, no and yes, mostly no on your first question.

A normal PNG image doesn't support layers. But, it does support an alpha channel.

The apha channel is kind of an image in the image, and it determines what part of an image that is transparent and what is not transparent. In most graphic editors (e.g. Gimp) it's represented as a gray image.

Basic examples on alpha channel:
  • If the alppha channel is completely white, then the image is fully visible (appears in most web browser as if there was no alpha channel).
  • If the alpha channel is all dark, then the image is fully transparent.
  • If the alpha channel is fading (left to right) black to white, it will make the image appear as ghosting from invisible to fully visible.
Some random info to try setting it in perspective
  • The alpha channel have the same dimension as the original image.
  • Think of it as a mask, where each pixel of the mask determine the degree of transparency of the pixel of the actual image.
Nb. There is a spechial kind of PNG images that support animations, those are reffered as aPNG if I remember it correctly. I assume each frame can be threaten as a layer.