# Format

Controls the output properties of the image.

# Adaptive filter &afNew!

Use adaptive row filtering for reducing the PNG file size. This only works when the output image is png.

# Base64 (data URL) &encoding=base64

Encodes the image to be used directly in the src= of the <img>-tag. Use this link to see the output result.

More info: Issue #59 - Return image base64 encoded.

//images.weserv.nl/?url=images.weserv.nl/lichtenstein.jpg&crop=100,100,720,530&encoding=base64

# Cache-Control &maxage=New!

Defines for how long an image should be cached by the browser. This will change the max-age of the Cache-Control HTTP-header.

We define a "far-future expiration" of 1 year by default. Valid durations that can be specified are:

  • 1 month (31 days)
  • 2 months
  • 3 months
  • 6 months
  • 1 year (365 days) - default

The duration can be specified in days and years, using the following suffixes:

  • d: days
  • y: years, 365 days

A value without a suffix means seconds. It is recommended to always specify a suffix.

More info: Issue #186 - Increase Cache-Control: max-age= to 1 year instead of 1 month.

//images.weserv.nl?url=images.weserv.nl/lichtenstein.jpg&w=100&maxage=31d

# Compression level &l=New!

The zlib compression level. Use a value between 0 (no Deflate) and 9 (maximum Deflate). The default value is 6. This only works when the output image is png.

# Default image &default=

If there is a problem loading an image, then a error is shown. However, there might be a need where instead of giving a broken image to the user, you want a default image to be delivered.

More info: Issue #37 - Return default image if the image's URL not found.

The URL must not include a default querystring (if it does, it will be ignored).

<img src="//images.weserv.nl/?url=example.org/noimage.jpg&default=ssl:images.weserv.nl%2F%3Furl%3Dimages.weserv.nl/lichtenstein.jpg%26w%3D300">

Default image

# Filename &filename=

To specify the filename returned in the Content-Disposition header. The filename must only contain alphanumeric characters.

More info: Issue #122 - Specify filename.

# Interlace / progressive &il

Adds interlacing to GIF and PNG. JPEG's become progressive.

More info: Issue #50 - Add parameter to use progressive JPEGs.

<img src="//images.weserv.nl/?url=images.weserv.nl/lichtenstein.jpg&w=300&il">

Interlace / progressive

# Number of pages &n=New!

To select the the number of pages to render. The default value is 1. Set to -1 to mean "until the end of the document".

TIP

-1 will be useful if you need to resize a animated WebP or GIF image.

<img src="//images.weserv.nl/?url=images.weserv.nl/banana.webp&h=300&output=gif&n=-1">

Number of pages

# Output &output=

Encodes the image to a specific format. Accepts jpg, png, gif, tiff, webp or json. If none is given, it will honor the origin image format.

More info: Issue #62 - Format conversion.

<img src="//images.weserv.nl/?url=images.weserv.nl/lichtenstein.jpg&w=300&output=webp">

Output

# Page &page=

To load a given page (for an PDF, TIFF and multi-size ICO file). The value is numbered from zero. For a multi-resolution image, you can use -1 to get the largest page and -2 to get the smallest page.

# Quality &q=

Defines the quality of the image. Use values between 0 and 100. Defaults to 85. This only works when the output image is jpg, tiff or webp.

<img src="//images.weserv.nl/?url=images.weserv.nl/lichtenstein.jpg&w=300&q=20">

Quality