Skip to content
UniKit

Chrome extension icon generator

Slices a source image (RGBA pixel JSON) into the 16 / 32 / 48 / 128 px PNGs a Chrome extension needs (256 optional), shrinking with an area-average filter and enlarging with nearest neighbour, then emits a paste-ready manifest.json icon block plus base64 for each size.

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

Source image (RGBA pixel JSON)

Generated icons

16 / 32 / 48 / 128 are the four sizes a Chrome extension manifest needs; shrinking uses an area average, enlarging uses nearest neighbour, then each image is encoded as PNG.

Paste RGBA pixel JSON to get every PNG size plus a manifest block

What this tool does

  • Slice an RGBA pixel JSON exported from a design file into the 16 / 32 / 48 / 128 icons a Chrome extension needs, instead of exporting each one by hand
  • Get a paste-ready manifest.json block (icons plus action.default_icon) whose paths are exactly icons/icon-<size>.png
  • Pull the base64 PNG of each size from result.sizes[].base64 for on-page previews or build scripts

Example

Input

{"width":2,"height":2,"pixels":[255,0,0,255,0,0,255,255,0,0,255,255,255,0,0,255]}

Output

icon-16.png: 16 × 16, 90 bytes
icon-32.png: 32 × 32, 109 bytes
icon-48.png: 48 × 48, 129 bytes
icon-128.png: 128 × 128, 408 bytes
manifest.json:
"icons": {
    "16": "icons/icon-16.png",
    "32": "icons/icon-32.png",
    "48": "icons/icon-48.png",
    "128": "icons/icon-128.png"
},
"action": {
  "default_icon": {
    "16": "icons/icon-16.png",
      "32": "icons/icon-32.png",
      "48": "icons/icon-48.png",
      "128": "icons/icon-128.png"
  }
}
files: icons/icon-16.png, icons/icon-32.png, icons/icon-48.png, icons/icon-128.png

Verbatim output for a 2×2 source with 256 off: 90 / 109 / 129 / 408 bytes for 16/32/48/128, 736 bytes in total. The example button inserts exactly this JSON.

Frequently asked questions

Why exactly 16 / 32 / 48 / 128?

Per the Chrome extension manifest documentation (manifest v3 icons / action.default_icon): 16 px is the extension page icon and favicon, 32 px is used on the Windows taskbar, 48 px on the extension management page and 128 px in the install dialog and on the Chrome Web Store. 256 px is not a Chrome requirement — it is only common for store assets, so it is off by default and can be switched on here.

Which resampling is used, and can it create dirty semi-transparent edges?

Downscaling (target ≤ the source’s long edge) uses an area average — a box filter over the covered source pixels. Upscaling uses nearest neighbour with no interpolation, so no new semi-transparent edge pixels are invented. Neither path uses randomness.

What format must the source JSON be in?

{"width":W,"height":H,"pixels":[…]} where pixels has length W × H × 4, row-major, with R,G,B,A per pixel in 0–255 (values outside the range are clamped). W and H must be positive integers and W × H must not exceed 4,000,000 (otherwise invalid-dimensions). The source does not have to be square; every output is square.

Is the output reproducible, and is my image uploaded?

Nothing is uploaded and the system clock is never read: the same JSON always produces byte-identical PNGs and manifest text. All work happens in local pure functions.

Are these real PNG files?

Yes. Every size goes through a PNG encoder, and the base64 starts with iVBORw0KGgo, so it can be written straight to a file such as icons/icon-16.png.

Keywords:Chrome extension icon generatorchrome-iconofflinedeterministic

Related tools