infery
← All models

Image2Pixel

image2pixel

Image editby infery

Turn images into pixel-perfect retro art

images

Details

Accepts
image

Pricing

Price
0.021 cr / second

Prices in credits (1 credit = $0.01).

Data schema

Input

FieldTypeDescription
scaleForce a specific pixel scale. If None, auto-detect.
image_urlrequiredstringThe image URL to process into improved pixel art
snap_gridbooleanAlign output to the pixel grid.
sync_modebooleanIf `True`, the media will be returned as a data URI and the output data won't be available in the request history.
max_colorsMaximum number of colors in the output palette. Set None to disable limit.
trim_bordersbooleanTrim borders of the image.
cleanup_jaggybooleanRemove isolated diagonal pixels (jaggy edge cleanup).
cleanup_morphbooleanApply morphological operations to remove noise.
detect_methodstringenum: auto, runs, edgeScale detection method to use.
fixed_paletteOptional fixed color palette as hex strings (e.g., ['#000000', '#ffffff']).
alpha_thresholdintegerAlpha binarization threshold (0-255).
background_modestringenum: edges, corners, midpointsControls where to flood-fill from when removing the background.
downscale_methodstringenum: dominant, median, mode, mean, content-adaptiveDownscaling method to produce the pixel-art output.
auto_color_detectbooleanEnable automatic detection of optimal number of colors.
background_toleranceintegerBackground tolerance (0-255).
transparent_backgroundbooleanRemove background of the image. This will check for contiguous color regions from the edges after correction and make them transparent.
dominant_color_thresholdnumberDominant color threshold (0.0-1.0).

Output

FieldTypeDescription
imagesarrayThe processed pixel-art image (PNG) and the scaled image (PNG).
palettearrayThe palette of the processed media.
num_colorsintegerThe number of colors in the processed media.
pixel_scaleintegerThe detected pixel scale of the input.