Formats

These parameters allow changing image formats and different parameters related to those formats.

input formats

Gumlet supports following input formats: JPEG, PNG, WebP, TIFF, PDF, GIF, SVG, RAW, HEIF.

output formats

Gumlet supports image output in following formats: JPEG, PNG, WebP, TIFF, GIF, SVG, RAW, HEIF.

metadata

Controls whether image metadata from original image should be kept in output image. If this parameter is set to true all metadata is kept.

Default value is false means all metadata will be removed to ensure smallest output image size.

format (fm)

Gumlet serves same image format as source image after performing operations. If you want to change output image format, you can use this parameter.

You can use auto, jpeg, jpg, png, webp, tiff, json or raw. If original image has alpha channel and output does not support transparency, a white background is applied if background parameter is not provided.

If you use format=auto, Gumlet automatically detects best format according to user browser. For example, Google Chrome supports WebP hence that format will be delivered to users visiting with Chrome browser. When user browser does not support WebP, default image format as per original image is served. WebP image is almost always lesser size for same image quality which results in lower bandwidth usage and faster load times.

json

format=json will return information about the original image or PDF. For example: https://demo.gumlet.com/boat.jpeg?format=json

{
"format": "jpeg",
"size": 68751,
"width": 752,
"height": 498,
"space": "srgb",
"channels": 3,
"density": 72,
"chromaSubsampling": "4:2:0",
"isProgressive": true,
"hasProfile": true,
"hasAlpha": false
}

If you would like to detect faces along with JSON information, you can pass faces=true along with format=json and the API will return detected face co-ordinates with other information.

For example if you are using Chrome, all images you saw above are delivered as WebP and not as JPEG. You can check it in content-type response header.

If you check total downloaded content in "Network" tab of Chrome and Firefox, you will see Chrome uses lesser bandwidth because of WebP image delivery.

pdf

PDF files can be converted to image using Gumlet API. You need to use page parameter to extract given page from a PDF file.

gif

We also support processing GIF images. If source image is GIF, you can pass any of width, height, stretch, extract, flip, rotate and gamma parameters while processing them. Other operations are not supported for GIF images as of now.

width=200
original
width=200
width=200
original
original

Converting other formats to GIF or converting GIF to other format is also not supported. Please contact us if you need any such support.

quality (q)

Sets output quality of image. q is an alias for this parameter. Valid values are between 0 and 100 inclusive of them.

This parameter only takes effect when using jpeg or webp as output format

Setting this parameter to 100 will produce highest quality image. Default value is 85.

page

If input is multi page image like GIF or anitmated WebP or PDF file, this parameter will extract page from the input and convert it to output format specified.

subsample (chromasub)

Enables or disables chroma subsampling. When it's set to true it applies 4:2:0 chroma subsampling. When it's set to false, it keeps chroma subsampling parameter to 4:4:4.

Default value is true.

compress

Gumlet automatically converts all JPEG images to progressive image and applies lossless quality optimizations by default.

If you set compress=true, we further apply lossy optimizations on image which can greatly reduce resultant image size without perceptual loss of quality. As illustrated in example below, most of time, it results in 30-50% reduction in resultant image size with almost no loss in quality.

This feature only works when output is produced in JPEG or PNG format.

compress=true (2.4 MB)
original (3.8 MB)
compress=true (2.4 MB)
compress=true - 2.4 MB
original (3.8 MB)
original - 3.8 MB