What is image transparency?
Image transparency is the ability of some pixels to let the content behind them show through, controlled by an alpha channel or, in simpler formats, a single transparent color.
By Rocco Bombardieri · Updated
Want the full walkthrough? Read: What is an alpha channel? (guide) →
Explained in more detail
Transparency lets an image sit on top of other content without a visible rectangle around it. A round logo placed on a colored web page is the usual case: the corners of the image file are still there, but they are transparent, so only the logo shows.
There are two kinds. Binary transparency means each pixel is either fully visible or fully hidden. GIF works this way: one palette index can be marked transparent. An indexed PNG can be used the same way, although PNG's palette alpha table can also hold partial values per entry. Partial transparency, also called alpha transparency, lets each pixel have any opacity between 0% and 100%. That is what produces smooth edges and soft shadows, and it is supported by PNG, WebP and AVIF through an alpha channel.
Transparency is a property of the file format as well as the image. JPEG has no way to store it. If you convert a transparent PNG or WebP to JPEG, the transparent pixels have to be replaced with a solid color, since JPEG only stores opaque pixels.
Transparent pixels still take up space in the file and in the pixel dimensions. A logo on a large transparent canvas is a large image even when the visible part is small. Trimming removes the empty border so the image is only as big as its content, which helps layout alignment and can reduce file size.
Note that "transparent" and "white" are different things. A white background is opaque white pixels; it will show as a white box on any non-white page.