{"course":{"slug":"image-editing","title":"Editing an Image","url":"https://addaly.com/learn/image-editing","level":"beginner","track":"create"},"lesson":{"slug":"alpha-and-the-fourth-channel","title":"Transparency is a number, and it carries a colour with it","url":"https://addaly.com/learn/image-editing/alpha-and-the-fourth-channel","position":5,"of":78,"minutes":9,"answer":"Alpha is a single coverage number per pixel that leaves the pixel's colour untouched, so transparency problems split into three separate causes (the wrong premultiply convention, contaminated edge colour.","keyIdea":"Alpha is a single coverage number per pixel that leaves the pixel's colour untouched, so transparency problems split into three separate causes (the wrong premultiply convention, contaminated edge colour, and formats that only store on-or-off) each with its own fix."},"body":{"format":"markdown","text":"## The fourth grey image\n\nAdd transparency to a file and you add a fourth channel beside red, green and blue. It holds one value per pixel, 0 to 255: 0 means this pixel shows nothing, 255 means it shows fully, and everything between is partial.\n\nThe checkerboard your editor draws behind a transparent area is not in the file. It is a display convention so you can tell transparent from white. Beginners export a PNG expecting the checkerboard to be there; it is not, because it never was.\n\nThe important thing about a partially transparent pixel is that it still has a colour. A pixel at alpha 128 is half-showing *some specific RGB value*. Which value that is turns out to be the source of most transparency problems.\n\n## Straight and premultiplied, and the fringe that tells you which\n\nThere are two conventions for what the RGB numbers mean when alpha is partial.\n\n**Straight (unassociated) alpha**: RGB holds the pixel's true colour, alpha holds coverage separately. PNG works this way, and so do most editors.\n\n**Premultiplied (associated) alpha**: RGB has already been multiplied by alpha. A half-transparent pure red is stored as (128, 0, 0, 128) rather than (255, 0, 0, 128). Many video codecs, rendering engines and compositing applications use this because it makes blending a cheaper operation.\n\nMix them up and the symptom is immediate and diagnosable. Treat premultiplied data as straight and the edges of everything go **dark**, because the values were already reduced and you reduce them again. Treat straight data as premultiplied and the edges go **bright** or washed out. If a logo handed to you from a motion designer has a black halo on every edge, that is the bug, and the fix is a checkbox in the import dialogue rather than a mask.\n\n## The grey halo that is not a premultiply bug\n\nThere is a second, much commoner fringe, and it has a different cause. Cut a subject out of a photograph and the edge pixels are mixtures: the sensor averaged subject and background into one value. Those mixed pixels get partial alpha, and they keep the colour they had, which includes the old background.\n\nPut that cut-out on white and you see a grey rim. Put a subject cut from a green wall onto a white page and you see a green rim. The alpha is correct. The **colour** underneath it is wrong, and no amount of contracting or feathering fixes it, because contracting just eats the edge and feathering smears the contamination further. Colour decontamination (rewriting those partial pixels' RGB to match the subject while keeping their alpha) is the only control that addresses the cause, and it gets a full lesson later in the course.\n\n## What each format can actually carry\n\n- **PNG-32**: 8-bit alpha, 256 levels. The dependable choice for a logo with soft edges.\n- **PNG-8**: one index in the palette is \"transparent\" and nothing else. That is 1-bit alpha: fully on or fully off. Soft edges become jagged. This is why a logo exported as a small PNG suddenly has staircase edges; it was saved as PNG-8 to make the file smaller.\n- **GIF**: the same 1-bit limitation, for the same reason.\n- **WebP and AVIF**: full 8-bit alpha, and considerably smaller than PNG for the same image. For web delivery of a cut-out with soft edges, WebP is usually the right answer now.\n- **TIFF**: full alpha, and also supports a **clipping path**, which is a vector outline stored alongside the pixels. Print workflows often want the path rather than the alpha, because a printer's layout software uses it to flow text round the shape.\n- **JPEG**: none. There is no such thing as a transparent JPEG. When a client's logo arrives sitting on a white box, this is why. The only fix is to obtain a PNG, SVG or the original artwork.\n- **SVG and other vector formats**: no pixels, so no alpha channel, but full opacity control on shapes. For a logo this is always the better delivery.\n\n## Matting: telling the file which background it is going to\n\nIf you already know the final background colour, you can bake it in. Export dialogues call this **matte**. Setting the matte to the page's background makes the semi-transparent edge pixels blend towards that colour, so even a 1-bit PNG-8 or GIF looks acceptable against that one background, and visibly wrong against any other.\n\nThis is a good trick for a fixed-colour email header and a bad habit for a logo you will reuse. Deliver the untouched straight-alpha version as the master and matted copies as extras, clearly named.\n\nFree tools throughout: GIMP has **Layer > Transparency > Colour to Alpha** and full alpha support, Photopea exports PNG-32 and WebP with alpha, and `magick in.png -background white -alpha remove out.jpg` does a matte from the command line in one line.\n\n## The limit built into a single number\n\nAlpha is one value per pixel. It says how much of the pixel gets through, and it cannot say *which wavelengths* get through. Real coloured glass, smoke, tinted plastic and water do not attenuate all three channels equally: red glass passes red and blocks green and blue.\n\nSo a cut-out of a red wine bottle with a correct alpha channel, placed on a blue background, is wrong: the transmitted colour behind the glass should be filtered, and alpha cannot filter. The professional answer is not a better mask; it is to composite the transmissive parts with blend modes (Multiply for what absorbs light, Screen or Add for what emits it) so the background actually passes through the tint. Cut-outs of glass, flame, smoke and hair-thin highlights are a compositing problem dressed up as a selection problem, which is why they take so long."},"check":{"question":"A cut-out of a red glass bottle with a clean, accurate alpha channel is placed over a blue background. The glass still looks as if it is holding the original studio background behind it rather than the blue. Why can a better mask not fix this?","options":[{"text":"The alpha channel is 1-bit, so partial transparency through the glass was never recorded.","correct":false,"tempting":"Assumes a format limitation the question rules out: the alpha is described as clean and accurate, and 1-bit alpha would show staircase edges rather than a wrong interior colour."},{"text":"Alpha controls how much of the pixel shows but not what colour passes through it, so tinted transmission has to be composited with a blend mode instead.","correct":true},{"text":"The file was premultiplied and is being read as straight, which is why the interior reads as the old background.","correct":false,"tempting":"Names a real bug with the wrong symptom: a premultiply mismatch darkens or brightens edges uniformly rather than preserving a background inside a transparent object."},{"text":"The mask needs decontaminating, because the glass pixels still carry colour from the studio background they were shot against.","correct":false,"tempting":"Applies an edge fix to an interior problem: decontamination corrects thin partial-alpha boundaries, while the body of transparent glass legitimately contains transmitted colour that must be re-computed against the new backdrop."}]},"prev":{"slug":"gamma-and-linear-light","title":"Mid-grey is not half the light","url":"https://addaly.com/learn/image-editing/gamma-and-linear-light"},"next":{"slug":"raw-and-the-mosaic","title":"Two thirds of the colour in your photo was calculated","url":"https://addaly.com/learn/image-editing/raw-and-the-mosaic"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Transparency is a number, and it carries a colour with it', in Editing an Image. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/image-editing/alpha-and-the-fourth-channel (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Transparency is a number, and it carries a colour with it","courseTitle":"Editing an Image","module":{"index":1,"slug":"what-an-image-is-made-of","title":"What an image is made of"},"answer":null,"keyIdea":"Alpha is a single coverage number per pixel that leaves the pixel’s colour untouched, so transparency problems split into three separate causes (the wrong premultiply convention, contaminated edge colour, and formats that only store on-or-off) each with its own fix.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"the-fourth-grey-image","runs":[{"text":"The fourth grey image"}]},{"t":"p","runs":[{"text":"Add transparency to a file and you add a fourth channel beside red, green and blue. It holds one value per pixel, 0 to 255: 0 means this pixel shows nothing, 255 means it shows fully, and everything between is partial."}]},{"t":"p","runs":[{"text":"The checkerboard your editor draws behind a transparent area is not in the file. It is a display convention so you can tell transparent from white. Beginners export a PNG expecting the checkerboard to be there; it is not, because it never was."}]},{"t":"p","runs":[{"text":"The important thing about a partially transparent pixel is that it still has a colour. A pixel at alpha 128 is half-showing "},{"text":"some specific RGB value","i":true},{"text":". Which value that is turns out to be the source of most transparency problems."}]},{"t":"h2","id":"straight-and-premultiplied-and-the-fringe-that-tells-you-whi","runs":[{"text":"Straight and premultiplied, and the fringe that tells you which"}]},{"t":"p","runs":[{"text":"There are two conventions for what the RGB numbers mean when alpha is partial."}]},{"t":"p","runs":[{"text":"Straight (unassociated) alpha","b":true},{"text":": RGB holds the pixel’s true colour, alpha holds coverage separately. PNG works this way, and so do most editors."}]},{"t":"p","runs":[{"text":"Premultiplied (associated) alpha","b":true},{"text":": RGB has already been multiplied by alpha. A half-transparent pure red is stored as (128, 0, 0, 128) rather than (255, 0, 0, 128). Many video codecs, rendering engines and compositing applications use this because it makes blending a cheaper operation."}]},{"t":"p","runs":[{"text":"Mix them up and the symptom is immediate and diagnosable. Treat premultiplied data as straight and the edges of everything go "},{"text":"dark","b":true},{"text":", because the values were already reduced and you reduce them again. Treat straight data as premultiplied and the edges go "},{"text":"bright","b":true},{"text":" or washed out. If a logo handed to you from a motion designer has a black halo on every edge, that is the bug, and the fix is a checkbox in the import dialogue rather than a mask."}]},{"t":"h2","id":"the-grey-halo-that-is-not-a-premultiply-bug","runs":[{"text":"The grey halo that is not a premultiply bug"}]},{"t":"p","runs":[{"text":"There is a second, much commoner fringe, and it has a different cause. Cut a subject out of a photograph and the edge pixels are mixtures: the sensor averaged subject and background into one value. Those mixed pixels get partial alpha, and they keep the colour they had, which includes the old background."}]},{"t":"p","runs":[{"text":"Put that cut-out on white and you see a grey rim. Put a subject cut from a green wall onto a white page and you see a green rim. The alpha is correct. The "},{"text":"colour","b":true},{"text":" underneath it is wrong, and no amount of contracting or feathering fixes it, because contracting just eats the edge and feathering smears the contamination further. Colour decontamination (rewriting those partial pixels’ RGB to match the subject while keeping their alpha) is the only control that addresses the cause, and it gets a full lesson later in the course."}]},{"t":"h2","id":"what-each-format-can-actually-carry","runs":[{"text":"What each format can actually carry"}]},{"t":"ul","items":[[{"text":"PNG-32","b":true},{"text":": 8-bit alpha, 256 levels. The dependable choice for a logo with soft edges."}],[{"text":"PNG-8","b":true},{"text":": one index in the palette is “transparent” and nothing else. That is 1-bit alpha: fully on or fully off. Soft edges become jagged. This is why a logo exported as a small PNG suddenly has staircase edges; it was saved as PNG-8 to make the file smaller."}],[{"text":"GIF","b":true},{"text":": the same 1-bit limitation, for the same reason."}],[{"text":"WebP and AVIF","b":true},{"text":": full 8-bit alpha, and considerably smaller than PNG for the same image. For web delivery of a cut-out with soft edges, WebP is usually the right answer now."}],[{"text":"TIFF","b":true},{"text":": full alpha, and also supports a "},{"text":"clipping path","b":true},{"text":", which is a vector outline stored alongside the pixels. Print workflows often want the path rather than the alpha, because a printer’s layout software uses it to flow text round the shape."}],[{"text":"JPEG","b":true},{"text":": none. There is no such thing as a transparent JPEG. When a client’s logo arrives sitting on a white box, this is why. The only fix is to obtain a PNG, SVG or the original artwork."}],[{"text":"SVG and other vector formats","b":true},{"text":": no pixels, so no alpha channel, but full opacity control on shapes. For a logo this is always the better delivery."}]]},{"t":"h2","id":"matting-telling-the-file-which-background-it-is-going-to","runs":[{"text":"Matting: telling the file which background it is going to"}]},{"t":"p","runs":[{"text":"If you already know the final background colour, you can bake it in. Export dialogues call this "},{"text":"matte","b":true},{"text":". Setting the matte to the page’s background makes the semi-transparent edge pixels blend towards that colour, so even a 1-bit PNG-8 or GIF looks acceptable against that one background, and visibly wrong against any other."}]},{"t":"p","runs":[{"text":"This is a good trick for a fixed-colour email header and a bad habit for a logo you will reuse. Deliver the untouched straight-alpha version as the master and matted copies as extras, clearly named."}]},{"t":"p","runs":[{"text":"Free tools throughout: GIMP has "},{"text":"Layer > Transparency > Colour to Alpha","b":true},{"text":" and full alpha support, Photopea exports PNG-32 and WebP with alpha, and "},{"text":"magick in.png -background white -alpha remove out.jpg","code":true},{"text":" does a matte from the command line in one line."}]},{"t":"h2","id":"the-limit-built-into-a-single-number","runs":[{"text":"The limit built into a single number"}],"role":"limit"},{"t":"p","runs":[{"text":"Alpha is one value per pixel. It says how much of the pixel gets through, and it cannot say "},{"text":"which wavelengths","i":true},{"text":" get through. Real coloured glass, smoke, tinted plastic and water do not attenuate all three channels equally: red glass passes red and blocks green and blue."}]},{"t":"p","runs":[{"text":"So a cut-out of a red wine bottle with a correct alpha channel, placed on a blue background, is wrong: the transmitted colour behind the glass should be filtered, and alpha cannot filter. The professional answer is not a better mask; it is to composite the transmissive parts with blend modes (Multiply for what absorbs light, Screen or Add for what emits it) so the background actually passes through the tint. Cut-outs of glass, flame, smoke and hair-thin highlights are a compositing problem dressed up as a selection problem, which is why they take so long."}]}],"check":{"question":[{"text":"A cut-out of a red glass bottle with a clean, accurate alpha channel is placed over a blue background. The glass still looks as if it is holding the original studio background behind it rather than the blue. Why can a better mask not fix this?"}],"options":[{"text":[{"text":"The alpha channel is 1-bit, so partial transparency through the glass was never recorded."}],"correct":false,"tempting":[{"text":"Assumes a format limitation the question rules out: the alpha is described as clean and accurate, and 1-bit alpha would show staircase edges rather than a wrong interior colour."}]},{"text":[{"text":"Alpha controls how much of the pixel shows but not what colour passes through it, so tinted transmission has to be composited with a blend mode instead."}],"correct":true,"tempting":null},{"text":[{"text":"The file was premultiplied and is being read as straight, which is why the interior reads as the old background."}],"correct":false,"tempting":[{"text":"Names a real bug with the wrong symptom: a premultiply mismatch darkens or brightens edges uniformly rather than preserving a background inside a transparent object."}]},{"text":[{"text":"The mask needs decontaminating, because the glass pixels still carry colour from the studio background they were shot against."}],"correct":false,"tempting":[{"text":"Applies an edge fix to an interior problem: decontamination corrects thin partial-alpha boundaries, while the body of transparent glass legitimately contains transmitted colour that must be re-computed against the new backdrop."}]}],"order":[0,2,1,3],"why":null},"prev":{"slug":"gamma-and-linear-light","title":"Mid-grey is not half the light","minutes":10},"next":{"slug":"raw-and-the-mosaic","title":"Two thirds of the colour in your photo was calculated","minutes":10}}}