Skip to content

Image2Pixel

Integrate

Model id image2pixel
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/image2pixel?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Up to $0.153 per run charged by actual usage, the rest is refunded Run it on this page

Get API key
Utility Image Editing #post-processing#pixel-art

Converts images to clean pixel art with palette limits, scale detection, and optional transparent background

Utility · Image

Your first result goes here

Build a request below and run it with your API key. Outputs are copied to our storage, kept forever or 7 days for free.

Build a request

Controls are generated from the model schema. The code and the price update as you change them.

•required image_url
Drop a file, or

Source image URL for conversion into improved pixel art.

Advanced detect_method · downscale_method · background_mode · max_colors · scale · alpha_threshold · dominant_color_threshold · background_tolerance · auto_color_detect · trim_borders · transparent_background · cleanup_morph · cleanup_jaggy · snap_grid · fixed_palette
detect_method default auto

Method used to detect the scale.

downscale_method default dominant

Method used to downscale into pixel art.

background_mode default corners

Starting locations for flood-fill during background removal.

default 32

Output palette color cap; None allows an unlimited number of colors.

Pixel scale to enforce; None enables automatic detection.

default 128

Threshold for binarizing alpha, from 0 to 255.

default 0.05

Threshold for dominant colors, from 0.0 to 1.0.

default 0

Tolerance for the background, from 0 to 255.

Optional predefined palette specified with hex strings, such as ['#000000', '#ffffff'].

POST /run/image2pixel?wait=20 quote → $0.153
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/image2pixel?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "image": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Run this request

Your key stays in this browser: it is sent only to the Doitong API and saved (localStorage) only if you tick Remember. Get an API key

About Image2Pixel

Turns an input image into pixel art and returns the processed image plus a scaled version as PNG files. You can cap the palette with `max_colors` (1 to 256), supply a `fixed_palette` of hex colors, or force a `scale` from 1 to 64. Several downscale methods, cleanup options and background removal modes are available. The response also reports the number of colors, the palette and the detected pixel scale.

Parameters

Send either the canonical name or the native name, not both. Canonical names

NameType DefaultAllowed Description
image_urlrequired image
Typeurl · image
Source image URL for conversion into improved pixel art.
max_colorsoptional
Typeinteger | null
Default32
1 – 256
Output palette color cap; None allows an unlimited number of colors.
auto_color_detectoptional
Typeboolean
Defaultfalse
Enables automatic selection of the optimal color count.
fixed_paletteoptional
Typestring[]
Optional predefined palette specified with hex strings, such as ['#000000', '#ffffff'].
detect_methodoptional
Typeenum
Defaultauto
autorunsedge
Method used to detect the scale.
scaleoptional
Typeinteger | null
1 – 64
Pixel scale to enforce; None enables automatic detection.
downscale_methodoptional
Typeenum
Defaultdominant
dominantmedianmodemeancontent-adaptive
Method used to downscale into pixel art.
trim_bordersoptional
Typeboolean
Defaultfalse
Controls trimming of image borders.
transparent_backgroundoptional
Typeboolean
Defaultfalse
Background removal through transparency: once image correction finishes, connected regions of color that touch an image edge become transparent.
cleanup_morphoptional
Typeboolean
Defaultfalse
Noise removal using morphological operations.
cleanup_jaggyoptional
Typeboolean
Defaultfalse
Jagged-edge cleanup by removing isolated diagonal pixels.
snap_gridoptional
Typeboolean
Defaulttrue
Snaps the output onto the pixel grid.
alpha_thresholdoptional
Typeinteger
Default128
0 – 255
Threshold for binarizing alpha, from 0 to 255.
dominant_color_thresholdoptional
Typenumber
Default0.05
0 – 1
Threshold for dominant colors, from 0.0 to 1.0.
background_toleranceoptional
Typeinteger
Default0
0 – 255
Tolerance for the background, from 0 to 255.
background_modeoptional
Typeenum
Defaultcorners
edgescornersmidpoints
Starting locations for flood-fill during background removal.
required Canonical name, also accepted

File parameters take a public https:// URL, a data: URI up to 10 MB, or the file_url of an upload. Files

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "image2pixel",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 153,
    "usd": "0.153",
    "charged": 153,
    "refunded": 0
  },
  "input": {
    "image_url": "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
  },
  "output": {
    "pixel_scale": 21,
    "palette": [
      "string"
    ],
    "num_colors": 10,
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ]
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Your files, your choiceEvery outputs[].url is a copy on our storage: kept forever (paid per GB-month) or 7 days for free, by your account setting or ?storage=.
Same shape on every modeltype, url, content_type, width, height and duration, for images, video and audio alike. output is the model’s own result object.
Fields of output
pixel_scale
integerPixel scale detected in the input.
palette
array of stringColor palette from the processed media.
num_colors
integerColor count for the processed media.
images
array of object {url, content_type, file_name, file_size, width, height}Processed pixel-art and scaled images, both in PNG format.

For AI agents: this page as Markdown is at https://doitong.com/en-GB/developers/models/image2pixel.md. All models and guides: https://doitong.com/developers/llms.txt