Model API

Image2Pixel

Turn images into pixel-perfect retro art

Model id

Use this in every request
image2pixel

Run it

Quote the input, start the generation with the quote, then poll the job. Set RAYWAKE_API_KEY first; see Authentication.

# 1. Price the exact input (quotes are valid for up to 10 minutes)
curl -s https://api.raywake.com/v1/quotes \
  -H "Authorization: Bearer $RAYWAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "image2pixel",
  "input": {
    "image_url": "https://example.com/input.png"
  }
}'

# 2. Start the generation with the quote_id from step 1
curl -s https://api.raywake.com/v1/generate \
  -H "Authorization: Bearer $RAYWAKE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{"model": "image2pixel", "quote_id": "QUOTE_ID", "input": {"image_url":"https://example.com/input.png"}}'

# 3. Poll until the status is terminal
curl -s https://api.raywake.com/v1/jobs/JOB_ID \
  -H "Authorization: Bearer $RAYWAKE_API_KEY"

Input

Input fields for image2pixel
NameTypeDescription
image_urlrequiredstring (image URL)
The image URL to process into improved pixel art
max_colorsinteger
Maximum number of colors in the output palette. Set None to disable limit.

Default: 32

auto_color_detectboolean
Enable automatic detection of optimal number of colors.

Default: false

fixed_palettearray of colors
Optional fixed color palette as hex strings (e.g., ['#000000', '#ffffff']).
detect_methodstring (enum)
Scale detection method to use.

Default: auto

One of: auto, runs, edge

scaleinteger
Force a specific pixel scale. If None, auto-detect.
downscale_methodstring (enum)
Downscaling method to produce the pixel-art output.

Default: dominant

One of: dominant, median, mode, mean, content-adaptive

trim_bordersboolean
Trim borders of the image.

Default: false

transparent_backgroundboolean
Remove background of the image. This will check for contiguous color regions from the edges after correction and make them transparent.

Default: false

cleanup_morphboolean
Apply morphological operations to remove noise.

Default: false

cleanup_jaggyboolean
Remove isolated diagonal pixels (jaggy edge cleanup).

Default: false

snap_gridboolean
Align output to the pixel grid.

Default: true

alpha_thresholdinteger
Alpha binarization threshold (0-255).

Default: 128

dominant_color_thresholdnumber
Dominant color threshold (0.0-1.0).

Default: 0.05

background_toleranceinteger
Background tolerance (0-255).

Default: 0

background_modestring (enum)
Controls where to flood-fill from when removing the background.

Default: corners

One of: edges, corners, midpoints

sync_modeboolean
If `True`, the media will be returned as a data URI and the output data won't be available in the request history.

Default: false

Output

A succeeded job lists its results under outputs, stored on our side. See Jobs for every field.

Job excerpt
"outputs": [
  { "type": "image", "url": "https://…", "mime_type": "image/png", "thumbnail_url": "https://…" }
]

Pricing

  • up to$0.09/ run

The exact charge for your input comes from a quote. How charges settle