Windows Icons

ICO Color Depth and Transparency Masks

Leena Taylor Paul By Updated August 18, 2026 10 min read
Quick Answer

An ICO stores each image at a color depth from 1 to 32 bit, and transparency comes either from a 1 bit AND mask on older icons or an 8 bit alpha channel on 32 bit ones. The alpha channel is what gives smooth edges. The Univik ICO Converter writes a clean 32 bit ICO with alpha from your image.

Two icons that look identical in a preview can behave nothing alike once they are on the desktop. One sits clean on any background, the other drags a black square behind it. The difference is color depth and how the icon handles transparency, and both are set deep in the file.

Here is what the depths mean, how old icons and modern ones each deal with transparency and why that black square shows up.

What Color Depth Means in an ICO

Color depth is the number of bits used to describe each pixel, and it sets how many colors that pixel can be. One bit gives two colors and eight bits give 256, and the number climbs from there. The general idea is set out under color depth.

An ICO is a container, so each image inside it can carry its own depth. A tiny 16 pixel entry might sit at a low depth while the 256 pixel entry runs at full color. That flexibility is part of why one .ico can serve so many places at once.

The Depths, 1 to 32 Bit

Five depths cover the history of the format. The first four differ only in how many colors they hold. The fifth adds something the others cannot, a channel for transparency.

Color depth and what each one holds
DepthColorsTransparency
1 bit2AND mask
4 bit16AND mask
8 bit256AND mask
24 bit16.7 millionAND mask
32 bit16.7 million8 bit alpha
The jump that matters is the last row, where a real alpha channel replaces the on or off mask.

The old low depths are mostly history now, kept alive for legacy files and the smallest icons. Modern work runs at 32 bit. To understand why the early ones look the way they do, it helps to see how they draw a transparent edge.

How Old Icons Handle Transparency

An icon below 32 bit does not store transparency in its color data at all. Instead it keeps two bitmaps stacked together. One is the color image, called the XOR bitmap. The other is a separate 1 bit map, the AND mask, that says which pixels are see through. The ICO format reference spells out how the two combine.

Two bitmaps make one classic icon
XOR bitmap
the colours
+
AND mask
what shows
final icon
composited
The colour image and the 1 bit mask are stored one above the other, then merged when the icon is drawn.

Because the mask holds a single bit per pixel, a pixel is either fully present or fully gone. There is no in between value, which is the whole limit of the old approach.

What the AND Mask Does

The AND mask is a stencil. For each pixel it stores one value. A 0 means keep the pixel, draw the color from the XOR bitmap. A 1 means drop it and let whatever sits behind the icon show through. Windows applies the mask first, then lays the color image over the top.

That two step blend is where the names come from, the mask is combined with the screen and then the color is applied over it. The same trick even allowed an icon to invert the pixels behind it, a feature from the days of single color displays. What it never allowed was a soft edge.

The 32 Bit Alpha Channel

A 32 bit icon works differently. It is a 24 bit color image with an extra 8 bit channel bolted on, the alpha channel, which stores an opacity value for every pixel. The idea of blending an image by a separate opacity layer is described under alpha compositing.

Eight bits of alpha give 256 levels of opacity per pixel rather than the two of the old mask. A pixel can be fully solid, fully clear or anything between, so an edge can fade out gradually and a soft drop shadow can sit under the art. This is what lets a modern icon melt into any background instead of stamping onto it.

A hard edge versus a soft one
1 bit mask
a hard, stepped edge
8 bit alpha
a smooth, faded edge
The old mask can only cut a pixel in or out, while alpha lets the edge taper.

Why an Icon Shows a Black Box or White Halo

This is where depth stops being trivia. When a 32 bit icon lands somewhere that ignores its alpha channel or the icon was built without a matching mask, the transparent pixels have no instruction to be clear. They fall back to whatever the color data holds, and that shows as a solid black square around the art.

The pale cousin of the same problem is a white halo, left when an icon was flattened against a white background before the transparency was set. Both trace back to the same root. The transparency information is missing or being skipped. A proper 32 bit ICO with a correct alpha channel is what removes them.

Which Depth to Choose

For almost every job today the answer is 32 bit. You get true color and a real alpha channel in one image, which handles smooth edges and any background without a second thought. The lower depths save a few bytes and suit a monochrome or retro look, and little else.

The one honest caveat is very small sizes. At 16 pixels the difference between depths is hard to see, so a low depth entry can be fine there. The story of those early low color icons is told in the guide on old Windows icons. Going the other way, an icon's alpha survives a trip back to a PNG, which the ICO to PNG guide covers.

Get a clean 32 bit icon with real alpha

Build an ICO that carries a full alpha channel from your image, so the edges stay smooth and no black box or white ring follows the icon around.

Free Download See All Features

Make a Clean 32 Bit ICO

The reliable fix for depth and transparency trouble is to rebuild the icon from a source with real transparency, a PNG for instance, so the alpha comes through intact. The Univik ICO Converter does that.

  1. Start with a transparent sourceUse a PNG that already has a clean alpha channel.
  2. Load it in the converterAdd the image and choose the sizes you want.
  3. Export at 32 bitThe converter writes each size with its alpha intact.
  4. Check the resultOpen it in the free viewer to see the depth and sizes.

Starting from a picture and building the icon is walked through in the PNG to ICO guide, and the free ICO viewer reports the depth of each image inside a file. The wider format, sizes and all, is broken down on the ICO file page. And if an icon looks broken because someone only renamed a PNG, that trap is covered in the guide on a renamed PNG.

Frequently Asked Questions

For anything modern, 32 bit. It carries true color plus a full alpha channel, so edges stay smooth and the icon sits cleanly on any background. Lower depths exist for old or tiny icons, but there is little reason to pick one now.

It is a 1 bit map that marks each pixel as either shown or transparent, nothing in between. Old icons pair it with the colour image to punch out the background. A 0 means draw the pixel and a 1 means let the background through.

An 8 bit icon holds up to 256 colours and switches transparency fully on or off through the AND mask. A 32 bit icon holds true colour and adds an 8 bit alpha channel, so pixels can be partly transparent and edges can fade smoothly.

It happens when the alpha channel is ignored or the transparency mask is wrong, so what should be clear renders as solid black. Rebuilding the icon as a proper 32 bit ICO with a correct alpha channel clears it.

The file structure still carries one, and some older systems fall back to it, but the 8 bit alpha channel is what drives transparency on a modern icon. A good converter writes both so the icon behaves everywhere.

It means every pixel is either fully visible or fully transparent, with no partial values. That is why icons built this way have hard, jagged edges. The 8 bit alpha channel replaced it to allow smooth, faded edges.
Leena Taylor Paul

Written and maintained by Leena Taylor Paul and the Univik team, developers of Windows data conversion and recovery software since 2013. The black box that sometimes shows behind an icon traces back to color depth and the transparency mask, so this guide walks through how an ICO stores its pixels and where that goes wrong. Last verified August 2026. Icon dragging a black box? Contact our support team.