Convert an image.
POST/image/convert
Convert an image.
Request
Header Parameters
- application/json
Bodyrequired
The image URL
The image as a Base64-encoded buffer. Can be specified instead of url.
The output format of the conversion.
Possible values: [jpeg, jpg, png, gif, tiff, webp]
Whether the image metadata should be converted, too.
options object
Quality. Applies to JPEG, PNG, WEBP, TIFF. Default for JPEG, WEBP, TIFF is 80. Default for PNG is 100.
Possible values: >= 1 and <= 100
80Quality of alpha layer. Applies to WEBP. Default is 100.
Possible values: >= 0 and <= 100
100Whether to use lossless compression. Applies to WEBP. Default is false.
falseWhether to use near_lossless compression. Applies to WEBP. Default is false.
falseWhether to use high quality chroma subsampling. Applies to WEBP. Default is false.
falseProgressive (interlace) scan. Applies to JPEG, PNG, GIF. Default is false.
falseChroma subsampling settings. 4:4:4 prevents subsampling if quality is at most 90. Applies to JPEG. Default is 4:2:0.
Possible values: [4:4:4, 4:2:0]
4:2:0Whether to use trellis quantization. Applies to JPEG. Default is false.
falseWhether to apply overshoot deringing. Applies to JPEG. Default is false.
falseWhether to use optimized progressive scans. This enables progressive. Applies to JPEG. Default is false.
falseAlternative spelling of optimiseScans.
Whether to use optimized Huffman coding tables. Applies to JPEG. Default is true.
trueAlternative spelling of optimiseCoding.
The quantization table that will be used. Applies to JPEG. Default is 0.
Possible values: >= 0 and <= 8
0Alternative spelling of quantisationTable.
Possible values: >= 0 and <= 8
Whether to use mozjpeg defaults. Default is false.
falseThe zlib compression level. Applies to PNG. Default is 6.
Possible values: >= 0 and <= 9
6Whether adaptive row filtering should be used. Applies to PNG. Default is false.
falseCPU effort for compression. For PNG and GIF, 1 is fastest, 10 is slowest, and enables palette. Default is 7. For WEBP, 0 is fastest, 6 is slowest. Default is 4.
7Use a palette-based image with an alpha channel. Applies to PNG. Default is false.
falseMaximum number of colors in palette. Applies to PNG and GIF. Default is 256.
256Alternative spelling of colours.
Level of Floyd-Steinberg error diffusion. Applies to PNG and GIF. Default is 1.0.
1Preset option. Applies to WEBP. Default is default.
Possible values: [default, photo, picture, drawing, icon, text]
defaultCompression option. Applies to TIFF. Default is jpeg.
Possible values: [none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k]
jpegCompression predictor setting. Applies to TIFF. Default is horizontal.
Possible values: [none, horizontal, float]
horizontalWrite an image pyramid. Applies to TIFF. Default is false.
falseEnable tiling mode. Applies to TIFF. Deault is false.
falseHorizontal tile size. Only applies when tile is true. Applies to TIFF. Default is 256.
256Vertical tile size. Only applies when tile is true. Applies to TIFF. Default is 256.
256Horizontal resolution in px/mm. Applies to TIFF. Default is 1.0.
1Vertical resolution in px/mm. Applies to TIFF. Default is 1.0.
1Reduce bitdepth. Applies to TIFF. Default is 8.
Possible values: [1, 2, 4, 8]
8Write 1-bit images as miniswhite. Applies to TIFF. Default is false.
falseResolution unit. Applies to TIFF. Default is inch.
Possible values: [inch, cm]
inchRe-use existing palette, otherwise generate new (slow). Applies to GIF. Default is false.
falseMaximum inter-frame error for transparency. 0 means lossless. Applies to GIF. Default is 0.
Possible values: >= 0 and <= 32
0Maximum inter-palette error for palette reuse. Default is 3.
Possible values: >= 0 and <= 256
3Whether the result image should be returned as a URL. Default is false.
The file name of the result image. Default is a random ID.
Responses
- 200
- 400
Success
- application/json
- application/octet-stream
- Schema
- Example (auto)
Schema
The result image URL.
{
"url": "string"
}
- Schema
Schema
Bad Request
- application/json
- Schema
- Example (auto)
Schema
{
"status": 0,
"errorMessage": "string"
}