Skip to content
UniKit

ICO to PNG

Extract every size from an ICO icon and turn it into PNG: a from-scratch ICONDIR reader that handles both BMP and PNG payloads while keeping transparency.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

Choose an icon

Parsing and conversion happen in the browser — the icon is never uploaded.

.ico and .cur are supported, with both BMP (DIB) and embedded PNG payloads.

Result

No icon directory read yet.

What this tool does

  • A designer hands you an .ico that packs 16/32/48/256 sizes — export them as PNG to use them straight in Figma or a deck.
  • Pull the 256×256 frame out of a favicon and reuse it as an og:image or PWA icon.
  • Check whether an icon really has an alpha channel: open the exported PNG on a transparent background and you will see it instantly.
  • Convert an old .cur cursor to PNG so you can eyeball every size before picking one.

Example

Input

A 2 × 2 32-bit ICO: the directory entry says 2 × 2 and the payload is a BITMAPINFOHEADER + BGRA bitmap + AND mask

Output

Exports icon-2x2.png (8-bit truecolor + alpha) where one pixel gets its alpha from the AND mask and another from the BGRA value 128

If a frame is already an embedded PNG (common for 256×256 after Vista), it is exported byte-for-byte without re-encoding.

Frequently asked questions

Why is the exported PNG bigger than the original ICO?

That is expected: the bitmap inside an ICO is an uncompressed DIB, while PNG re-compresses it with zlib. Small frames (16×16, 32×32) are only a few hundred bytes, so PNG header overhead dominates and the file grows. The larger the icon, the more PNG wins.

How is transparency handled?

By the Windows icon rules: 32-bit frames read alpha straight from BGRA, while 1/4/8/24-bit frames have no alpha and rely on the AND mask — pixels whose mask bit is set become fully transparent. If a 32-bit frame has an all-zero alpha channel (a common artefact of old exporters) it is treated as opaque so the image does not vanish.

Which bit depths are supported?

1, 4 and 8-bit palettes plus 24 and 32-bit truecolor, which covers practically every icon you will meet. 16-bit (RGB555/RGB565) and RLE-compressed DIBs are not supported yet — you get a clear error instead of a wrong image.

Do CUR cursor files work too?

Yes. CUR and ICO share the same container, only the type field differs (1 = icon, 2 = cursor); the extra hotspot coordinates in the directory are ignored and each size is still exported as PNG.

Is the icon uploaded?

No. Parsing and PNG encoding both happen in the browser: the DIB decoder is a hand-written pure JS implementation, and PNG output is produced by zlib-compressing the scanlines and writing the chunks and CRCs ourselves. No network requests, and nothing survives a page reload.

Keywords:ico 转 png图标提取favicon 转 pngico to pngicon extractoricondirbmp 图标解码多尺寸图标cur 文件图标转换

Related tools