Skip to content
pdfconversionapi

KRA to ICO API

POST a .kra to /v2/convert/kra/to/ico and get an icon file holding one PNG-compressed, 32-bit image of the merged artwork. Anything larger than 256 px is fitted into 256 × 256, so the 320 px sample comes back at 256 × 256.

Endpoint
POST /v2/convert/kra/to/ico
Accepts
kra
Sample timing
26 ms median of 5 runsHow we measure
Request size
Up to 10 MB on the Free plan or 100 MB on paid plans, all files together

Request and response

Every sample below ran against the API before this page was published. Set PDFCONVERSIONAPI_KEY to your key and run it as is.

curl -sS -X POST \
  https://api.pdfconversionapi.com/v2/convert/kra/to/ico \
  -H "Authorization: Bearer $PDFCONVERSIONAPI_KEY" \
  -F File=@rocket-sticker.kra \
  -o response.json

# FileData is base64. Save the first file in converted/,
# or print the JSON error.
if jq -e '.Files' response.json > /dev/null; then
  mkdir -p converted
  name=$(jq -r '.Files[0].FileName' response.json)
  jq -r '.Files[0].FileData' response.json \
    | base64 --decode > "converted/$name"
else
  cat response.json
fi
200 OK26 ms median1 file, 25 KB
{
  "ConversionCost": 1,
  "ConversionTime": 0.026,
  "Files": [
    {
      "FileName": "rocket-sticker.ico",
      "FileExt": "ico",
      "FileSize": 25960,
      "FileData": "AAABAAEAAAAAAAAAIABSZQAA…"
    }
  ]
}

Response from our test run on 2026-11-03. ConversionTime shows the median of 5 runs. FileData is shortened here; the real response carries the whole file as base64.

The sample, converted

The same file the code sends. Download the input and the output and compare them yourself.

First page of rocket-sticker.ico, rendered by the API
Input
rocket-sticker.kra (108 KB)
Output
rocket-sticker.ico (25 KB)
Source
A cartoon rocket sticker on a transparent canvas that we drew and saved as a six-layer KRA file (one layer hidden, one faded by a transparency mask). (CC0-1.0). How it was made
Made by
2026-11-04, API build 9eeeb0640aba

Parameters

Send these as form fields next to the file. Names are case-insensitive. If you set one of the documented options below that we don't support yet, the request fails with a 400 that names it instead of returning a file made without it.

ParameterWhat it does
ImageWidthintegerIcon width. 48 gave a 48 × 48 icon of 2,516 bytes and 64 one of 3,786; 800 still came out at 256 × 256, since that is the ICO maximum.Values: 1–20000 (the icon is still capped at 256)
ImageHeightintegerIcon height; with a width, the drawing is fitted into the box.Values: 1–20000
ScaleProportionsboolean, default truefalse lets a non-square box such as 200 × 100 squash the art (10,920 bytes).
ScaleIfLargerboolean, default falsetrue stops the canvas from being enlarged before the 256 px fit.
ScaleImageboolean, default truefalse crops instead; a 120 × 90 crop of the sticker is blank canvas, 544 bytes.
ColorSpaceenum, default defaultgray or monochrome icons keep the transparent background (26,109 and 9,037 bytes). In the monochrome one every color is pure black or pure white, while the soft edges keep their partial alpha.Values: default, rgb, gray, monochrome (also srgb, truecolors, grayscale); cmyk returns 400
FileNamestringThe icon's name; defaults to rocket-sticker.ico.
StoreFileboolean, default falseStores the .ico for 3 hours and returns its URL.

What carries over, and what doesn't

Kept

  • Alpha: 53,035 of the 65,536 pixels in the 256 px icon are fully transparent, and soft edges stay soft
  • The merged layers, scaled with a Lanczos3 filter to fit 256 × 256
  • PNG compression inside the icon: the 256 px entry is 25,938 bytes of a 25,960-byte file

Lost or not yet supported

  • Multiple sizes in one file. The ICO holds a single image; ask for each size separately.
  • Detail above 256 px. The 320 px sample is scaled down to 256 × 256.
  • The 300 ppi stored in the .kra; the icon records no resolution.
  • Krita layers that are not paint layers, such as vector text, which are left out.

Limits

  • One .kra per call, canvas up to 100,000,000 pixels and 300,000 px per side before scaling.
  • Requests up to 10 MB on the Free plan or 100 MB on paid plans, all files and fields together.
  • A 504 after 120 seconds.
  • Icons are at most 256 × 256 and contain one image.

Where teams use it

Favicons and app icons drawn in Krita

Paint the icon in Krita at a comfortable size, then request the sizes you ship, such as ImageWidth=48 or ImageWidth=256, one call each. The transparent canvas around the art stays transparent.

Desktop shortcuts for internal tools

Teams that brand internal Windows tools can keep the icon source as a layered .kra and regenerate the .ico in a build step.

Questions

Can one ICO contain 16, 32, 48 and 256 px versions?

Not yet. Each request writes one image into the icon file. Make one request per size, or pack the PNGs into a multi-size icon with another tool.

Why is my icon 256 × 256 when the canvas is bigger?

The ICO format stores at most 256 px per side, so larger merges are fitted into 256 × 256 with the aspect ratio kept. The 320 × 320 sample becomes 256 × 256; a 400 × 300 canvas would become 256 × 192.

Is the image inside the ICO a PNG or a bitmap?

A PNG. The single directory entry points to 32-bit PNG data rather than a bitmap, which keeps the 256 px rocket icon at 25,960 bytes.

Convert your first KRA file in a minute.