Palette — color palette reduction
Palette — color palette reduction
Quantize an image down to a limited palette. Useful for shrinking indexed PNGs and GIFs before deployment.
Parameters
Must be
"palette".Path to the source image.
Directory where the palette-reduced file will be written.
Maximum number of colors in the output palette. Range: 2–256.
Dithering strength applied during quantization to reduce color banding. Range:
0.0 (none) to 1.0 (maximum).Output format.
png is typical for palette-reduced output.Go client
Examples
Go
Favicon — multi-size favicon generation
Favicon — multi-size favicon generation
Generate a
The convenience method enables both
favicon.ico and individual PNG sizes from a single SVG or raster source.Parameters
Must be
"favicon".Path to the source image. SVG inputs produce the sharpest results at all sizes.
Directory where favicon files will be written.
Array of square sizes in pixels to generate. Common values:
16, 32, 48 for browsers; 180 for Apple Touch Icon; 192, 512 for PWA manifest icons.When
true, generates a multi-size favicon.ico bundling the 16×16, 32×32, and 48×48 sizes.When
true, generates a site.webmanifest JSON file referencing the PNG icons.Output files
| File | Description |
|---|---|
favicon.ico | Multi-size ICO file (when generate_ico: true) |
favicon-{size}.png | Individual PNG at each requested size |
site.webmanifest | PWA manifest (when generate_manifest: true) |
Go client
generate_ico and generate_manifest. For custom sizes, use Client.Execute() with a FaviconJob:Example
JSON
Go
Sprite — sprite sheet generation
Sprite — sprite sheet generation
Pack multiple images into a single sprite sheet. Optionally generate a CSS file with background-position rules for each sprite.
Parameters
Must be
"sprite".Ordered array of input image paths. Images are placed left-to-right, top-to-bottom.
Path for the output sprite sheet image.
Number of columns in the sprite grid.
Pixel gap between sprites in the grid.
When
true, generates a .css file alongside the sprite sheet with background-position rules for each input image.Fixed cell size in pixels. When set, all sprites are scaled to fit this square cell. When omitted, cell dimensions match the largest input image.
Go client
Example
JSON
Go
Placeholder — LQIP and dominant color
Placeholder — LQIP and dominant color
Generate a low-quality blurred preview (LQIP) or extract the dominant color of an image. Both are useful for progressive loading — display the placeholder immediately while the full image loads.
Parameters
Must be
"placeholder".Path to the source image.
Placeholder type.
| Value | Description |
|---|---|
lqip | Low-quality blurred thumbnail, returned as base64 inline data URI |
dominant | Extract dominant color; returned as hex in response metadata |
Width of the LQIP thumbnail in pixels. Smaller values produce smaller data URIs. Used when
kind is "lqip".Output format for LQIP thumbnails.
Encode quality for the LQIP thumbnail. Low values (20–40) are typical.
When
true, the LQIP image is returned as a base64-encoded string in data_base64.Response — dominant color
Whenkind is "dominant", the response metadata field contains:Go client
Examples
Go
Srcset — responsive image variants
Srcset — responsive image variants
Generate a set of width-scaled variants and optionally emit an HTML
<img> tag with the srcset attribute pre-populated.Parameters
Must be
"srcset".Path to the source image.
Directory where generated image variants will be written.
Array of target widths in pixels. Each produces a separate output file.
Pixel density multipliers.
[1.0, 2.0] produces standard and retina variants at each width.Output format:
png, jpeg, webp, or avif.Encode quality for JPEG and WebP outputs. Range: 1–100.
When
true, the response metadata includes a ready-to-use <img> element with src and srcset attributes.When
true, resize is performed in linear light for higher accuracy.Output filename pattern
| Density | Pattern | Example |
|---|---|---|
| 1× | {name}-{width}w.{ext} | hero-640w.webp |
| Other | {name}-{width}w-{density}x.{ext} | hero-640w-2x.webp |
Go client
Example
JSON
Go
EXIF — metadata management
EXIF — metadata management
Strip, preserve, extract, or apply EXIF orientation data. Use this to sanitize images before public upload, correct camera orientation, or read camera metadata.
Parameters
Must be
"exif".Path to the source image.
Path for the output file. Required for
strip, preserve, and auto_orient. Not needed for extract.EXIF operation type.
| Value | Description |
|---|---|
strip | Remove EXIF data according to mode |
preserve | Remove all EXIF except tags listed in keep |
extract | Read and return EXIF metadata without writing a file |
auto_orient | Apply the EXIF orientation rotation to pixel data, then remove the tag |
Controls which data is stripped when
exif_op is "strip".| Value | Description |
|---|---|
all | Remove all EXIF data |
gps | Remove GPS coordinates only |
thumbnail | Remove embedded thumbnail only |
camera | Remove camera make and model only |
Array of EXIF tag names to retain when
exif_op is "preserve". All other tags are removed.When
true, the response metadata field contains the parsed EXIF data. Relevant for extract and useful for inspecting results from other operations.Output format.
Encode quality for JPEG and WebP outputs. Range: 1–100.
When
true, the output is also returned as a base64-encoded string in data_base64.Extracted metadata fields
Whenexif_op is "extract" or return_metadata is true, the response metadata object may contain:Go client
Examples
Go
AutoQuality — binary-search quality optimization
AutoQuality — binary-search quality optimization
Automatically determine the highest JPEG/WebP/AVIF quality that still meets a target file size, using binary search. Returns convergence metadata so you can audit the result.
Parameters
Must be
"quality".Path to the source image.
Path for the optimized output file.
Target file size in bytes. The engine finds the quality setting that produces a file as close to this size as possible without exceeding
tolerance_percent.Output format. Must be a lossy format:
jpeg, webp, or avif.Acceptable deviation from
target_size as a percentage. The search stops when it achieves a result within this tolerance.Maximum number of binary search iterations before stopping.
Lower bound for the quality search range.
Upper bound for the quality search range.
When
true, the output is also returned as a base64-encoded string in data_base64.Response metadata
Themetadata field of the response reports the outcome of the binary search:| Field | Type | Description |
|---|---|---|
target_size | number | Requested target in bytes |
final_quality | number | Quality setting selected |
final_size | number | Actual output file size in bytes |
deviation_percent | number | Deviation from target as a percentage |
iterations | number | Number of iterations performed |
converged | boolean | Whether the search met the tolerance |
Go client
Examples
Go