Images.weserv.nl is an image cache & resize proxy. Our servers resize your image, cache it worldwide, and display it.

We're part of the Cloudflare community. Images are being cached and delivered straight from 100+ global datacenters. This ensures the fastest load times and best performance. On average, we resize 1 million (106) images per hour, which generates around 25TB of outbound traffic per month.

Requesting an image:

  • ?url= (URL encoded) link to your image, without http://

Deprecated

In January 2016 we introduced Version 2 of the Images.weserv.nl API. To make room for new improvements some parameters will be changed in the future.
We also kept Version 1 (which is in place since December 2010) of the API in place so as not to break anyone's apps. Please update your code to use the changed API parameters.

Deprecated URL-parameter values

GET Value Use instead  
a =t =top info
a =b =bottom info
a =l =left info
a =r =right info
trim =sensitivity between 0 and 255 =percentaged tolerance level between 0 and 100 info
output =gif =jpg, =png or =webp info

Deprecated URL-parameters

GET Use instead  
circle shape=circle info

Quick reference

Name GET Description  
Width w Sets the width of the image, in pixels. info
Height h Sets the height of the image, in pixels. info
Orientation or Rotates the image. info
Transformation t Sets how the image is fitted to its target dimensions. info
Crop crop Crops the image to specific dimensions. info
Crop alignment a Sets how the crop is aligned. info
Shape shape Crops the image to a specific shape. info
Brightness bri Adjusts the image brightness. info
Contrast con Adjusts the image contrast. info
Gamma gam Adjusts the image gamma. info
Sharpen sharp Sharpen the image. info
Trim trim Trim "boring" pixels from all edges. info
Blur blur Adds a blur effect to the image. info
Filter filt Applies a filter effect to the image. info
Background bg Sets the background color of the image. info
Quality q Defines the quality of the image. info
Output output Encodes the image to a specific format. info
Interlace / progressive il Adds interlacing to GIF and PNG. JPEG's become progressive. info
Base64 (data URL) encoding Encodes the image to be used directly in the src= of the <img>-tag. info

Size

Width &w=

Sets the width of the image, in pixels.

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

Height &h=

Sets the height of the image, in pixels.

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

Orientation New!

Orientation or

Rotates the image. Accepts auto, 0, 90, 180 or 270. Default is auto. The auto option uses Exif data to automatically orient images correctly.

<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&h=300&or=90">

Transformation &t=

Sets how the image is fitted to its target dimensions. Below are a couple of examples.

Fit &t=fit

Default. Resizes the image to fit within the width and height boundaries without cropping, distorting or altering the aspect ratio. Will not oversample the image if the requested size is larger than that of the original.

<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&w=300&h=300&t=fit">

Fitup &t=fitup

Resizes the image to fit within the width and height boundaries without cropping, distorting or altering the aspect ratio. Will increase the size of the image if it is smaller than the output size.

<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&w=300&h=300&t=fitup">

Square &t=square

Resizes the image to fill the width and height boundaries and crops any excess image data. The resulting image will match the width and height constraints without distorting the image. Will increase the size of the image if it is smaller than the output size.

<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&w=300&h=300&t=square">

Squaredown &t=squaredown

Resizes the image to fill the width and height boundaries and crops any excess image data. The resulting image will match the width and height constraints without distorting the image. Will not oversample the image if the requested size is larger than that of the original.

<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&w=300&h=300&t=squaredown">

Absolute &t=absolute

Stretches the image to fit the constraining dimensions exactly. The resulting image will fill the dimensions, and will not maintain the aspect ratio of the input image.

<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&w=300&h=300&t=absolute">

Letterbox &t=letterbox New!

Resizes the image to fit within the width and height boundaries without cropping or distorting the image, and the remaining space is filled with the background color. The resulting image will match the constraining dimensions.

More info: #9495519 - letterbox images that need to fit

<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&w=300&h=300&t=letterbox&bg=black">

Crop position &a=

You can also set where the image is cropped by adding a crop position. Only works when t=square. Accepts top, left, center, right or bottom. Default is center. For more information, please see the suggestion on our UserVoice forum: #2570350 - Aligning.

<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&w=300&h=300&t=square&a=top">

Crop Focal Point New!

In addition to the crop position, you can be more specific about the exact crop position using a focal point. Only works when t=square. This is defined using two offset percentages: crop-x%-y%.

<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&w=300&h=300&t=square&a=crop-25-45">

Manual crop &crop=

Crops the image to specific dimensions prior to any other resize operations. Required format: width,height,x,y.

<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&crop=300,300,680,500">

Shape

Shape &shape=

Crops the image to a specific shape. More info: #3910149 - Add circle effect to photos.

Accepts:

  • circle
  • ellipse
  • triangle
  • triangle-180: Triangle tilted upside down
  • pentagon
  • pentagon-180: Pentagon tilted upside down
  • hexagon
  • square: Square tilted 45 degrees
  • star: 5-point star
<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&w=300&h=300&t=square&shape=circle">

Adjustments New!

Brightness bri

Adjusts the image brightness. Use values between -100 and +100, where 0 represents no change.

<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&w=300&bri=-25">

Contrast con

Adjusts the image contrast. Use values between -100 and +100, where 0 represents no change.

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

Gamma gam

Adjusts the image gamma. Use values between 1 and 3. The default value is 2.2, a suitable approximation for sRGB images.

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

Sharpen sharp

Sharpen the image. Required format: f,j,r

Arguments:

  • Flat f - Sharpening to apply to flat areas. (Default: 1.0)
  • Jagged j - Sharpening to apply to jagged areas. (Default: 2.0)
  • Radius r - Sharpening mask to apply in pixels, but comes at a performance cost. (optional)
<img src="//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&w=300&sharp=5,5,3">

Trim trim

Trim "boring" pixels from all edges that contain values within a percentage similarity of the top-left pixel. Trimming occurs before any resize operation. Use values between 0 and 100 to define a percentaged tolerance level to trim away similar color values. You also can specify just &trim, which defaults to a percentaged tolerance level of 10.

More info: #3083264 - Able to remove black/white whitespace

<img src="//images.weserv.nl/?url=ssl:upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png&w=300&trim=10">

Background bg

Sets the background color of the image. Supports a variety of color formats. In addition to the 140 color names supported by all modern browsers (listed here), it also accepts hexadecimal RGB and RBG alpha formats.

Hexadecimal

  • 3 digit RGB: CCC
  • 4 digit ARGB (alpha): 5CCC
  • 6 digit RGB: CCCCCC
  • 8 digit ARGB (alpha): 55CCCCCC
<img src="//images.weserv.nl/?url=ssl:upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png&w=400&bg=black">

Effects New!

Blur blur

Adds a blur effect to the image. Use values between 0 and 100.

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

Filter filt

Applies a filter effect to the image. Accepts greyscale or sepia.

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

Encoding

Quality &q=

Defines the quality of the image. Use values between 0 and 100. Defaults to 85. Only relevant if the format is set to jpg.

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

Output &output=

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

More info: #5097964 - Format conversion.

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

Interlace / progressive &il

Adds interlacing to PNG. JPEG's become progressive.

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

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

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: #4522336 - Return image base64 encoded.

//images.weserv.nl/?url=rbx.weserv.nl/lichtenstein.jpg&crop=100,100,680,500&encoding=base64