Formats

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

input size

Gumlet supports input images upto 16,384x16384 pixels. This limit is only available in Business and Enterprise plans. For the Free plan, the input image size is limited to 6000x6000 pixels. If input image is bigger than this, Gumlet will not process the image and only pass it through. For the growth plan, the limit is 8192x8192 pixels.

input formats

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

output formats

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

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,jxl, png, webp, tiff, json, avif, heif 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 input image or PDF. For example: https://demo.gumlet.io/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": false,
  "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=200original
width=200original

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 false.

pngcomp

Specifies compression level for PNG output. This parameter should be between 1 and 9. Default value is 6. Value of 9 gives best compression but takes long time to compress.

progressive

Enable/Disable progressive image scan. 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 MBoriginal - 3.8 MB

dl (Download)

When used in a link, dl will force the browser to download the image instead of opening it in a new window. Set the value to your desired filename. If no value is set, the downloaded image filename will be identical to the original.

<a href="https://demo.gumlet.io/sea.jpeg?w=450&dl=medium.jpg">
  Download
</a>

Try Image Download