Model API
Image2Pixel
Turn images into pixel-perfect retro art
Model id
image2pixelRun 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
| Name | Type | Description |
|---|---|---|
image_urlrequired | string (image URL) | The image URL to process into improved pixel art |
max_colors | integer | Maximum number of colors in the output palette. Set None to disable limit. |
auto_color_detect | boolean | Enable automatic detection of optimal number of colors. |
fixed_palette | array of colors | Optional fixed color palette as hex strings (e.g., ['#000000', '#ffffff']). |
detect_method | string (enum) | Scale detection method to use. |
scale | integer | Force a specific pixel scale. If None, auto-detect. |
downscale_method | string (enum) | Downscaling method to produce the pixel-art output. |
trim_borders | boolean | Trim borders of the image. |
transparent_background | boolean | Remove background of the image. This will check for contiguous color regions from the edges after correction and make them transparent. |
cleanup_morph | boolean | Apply morphological operations to remove noise. |
cleanup_jaggy | boolean | Remove isolated diagonal pixels (jaggy edge cleanup). |
snap_grid | boolean | Align output to the pixel grid. |
alpha_threshold | integer | Alpha binarization threshold (0-255). |
dominant_color_threshold | number | Dominant color threshold (0.0-1.0). |
background_tolerance | integer | Background tolerance (0-255). |
background_mode | string (enum) | Controls where to flood-fill from when removing the background. |
sync_mode | boolean | If `True`, the media will be returned as a data URI and the output data won't be available in the request history. |
Output
A succeeded job lists its results under outputs, stored on our side. See Jobs for every field.
"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