What is an alpha channel? How an image stores transparency

Published , by the PrintBlob team.

An alpha channel is a fourth value stored with the red, green and blue of every pixel, giving how opaque that pixel is, from fully transparent to fully solid. Without one, an image is a rectangle of colours. With one, the same rectangle can hold a shirt design with nothing around it, soft edges and see-through areas included. Every print file with a “transparent background” depends on it.

What the numbers are

The PNG specification is explicit. In a PNG with alpha, transparency is one extra sample per pixel, stored at the same depth as the colour samples, 8 or 16 bits. A value of 0 is fully transparent and the maximum, 255 at 8 bits, is fully opaque; anything between is partly transparent. Colour values are not premultiplied by alpha, so a pixel keeps its own colour even when it is nearly clear. CSS counts the same quantity from 0 to 1, or 0 to 100 per cent.

At 8 bits there are 256 steps, which means there are 254 values between “gone” and “solid”. Each is a pixel that is partly see-through, and each is a problem for a DTF or DTG printer that must decide between ink and no ink.

Where alpha exists

Format Alpha? Notes
PNG Yes, 8 or 16 bits, or a single transparent colour (tRNS) The standard for transparent print files
WebP Yes, in lossy and lossless modes Google: lossless alpha costs about 22 per cent more bytes
SVG Alpha masks, as part of its drawing model The W3C lists them beside clipping paths and filters
JPEG No Always a rectangle

The PNG specification also describes a lighter alternative: for greyscale or truecolour images, a tRNS chunk can name one colour whose pixels are fully clear and treat all the rest as solid; for indexed images it can give each palette entry its own alpha. A file made that way can only be clear or solid, with no half-transparent pixels, which is the case DTF handles best.

Alpha in an editor

  • The chequerboard shows where alpha is below solid.
  • Layer opacity changes a layer’s alpha overall. In GIMP’s manual, a fully opaque top layer in Normal mode hides everything beneath it, and at 50 per cent the layers below show through, which is how a 90 per cent layer ends up printing as semi-transparency.
  • Flattening onto a background removes the alpha channel: GIMP’s Flatten Image merges all layers into one with no alpha channel, and areas transparent in every layer take the background colour.

What printers do with it

Printify’s setup guide asks for a background that is fully transparent and an 8-bit alpha channel, and warns that any pixel above zero opacity can trigger white underbase on dark garments. Printful warns that partial transparency may print unpredictably in DTG. The practical rule is to give every pixel alpha 0 or the maximum, and to let anti-aliasing be the only exception, at the edge.

In PrintBlob

PrintBlob writes each printed side as a PNG with an alpha channel, at the print area’s size and with a transparent background (the front’s in the free plugin, every other side’s with PrintBlob Pro). Uploads in PNG and WebP can carry alpha; JPEG cannot. The DTF image checker counts pixels by alpha: fully transparent, fully opaque and in between, and reports the in-between ones that are not simple edge smoothing.

Sources