a free responsive image service.

Resize.

Rotate.

Manipulate.

What is RSZ.IO?

RSZ.IO is an image resizing proxy that can resize images, change image formats and optimize images for your web site.

RSZ.IO is already configured to work with your web site. You don't need to register or get an api key. There is no software to install on your server. And RSZ.IO is completely free for most web sites.

RSZ.IO currently serves about 4 million images per day.

Using RSZ.IO

It's super easy. Take the url to any image on your site, and add ".rsz.io" to the end of your domain name, and image resizing parameters at the end of the url. For example:

http://mydomain.com.rsz.io/images/photo.jpg?width=200

Go ahead and try it now, on your own site, or the images on any web site. It already works.

Or, if you want the images to be hosted on your own domain, create a cname dns record that points to rsz.io. For example, by adding this cname record:

CNAME images.mydomain.com mydomain.com.rsz.io

You can now resize images on a subdomain of your site, like this:

http://images.mydomain.com/images/photo.jpg?width=200

See our complete RSZ.IO API documentation

What RSZ.IO can do

Resize images, by providing a desired width and or height, in pixels or as a percentage:

Convert between image formats:

Rotate and flip images:

Blur images:

Optimize images automatically using client hints and automatic format selection:

Get unprecedented control of the resize operation by defining your own affine transformations or choosing your own interpolator ( nearest, bilinear, bicubic, lbb, nohalo or vsqbs ):

Get detailed performance information on every image operation with the "prog-info" parameter:

Instead of returning an image, this will return a detailed performance report:

Source image: "http://critterbabies.com.rsz.io/wp-content/gallery/kittens/Cute-Kittens-kittens-16094704-1280-800.jpg"
Original width: 0 height: 0
Decoded  width: 512 height: 512
Output   width: 250 height: 250

ImageProgram:
   Input dimensions, width: 512 height: 512
   0: Blur        radius: 2
   1: Affine      a: 0.488281, b: 0.000000, c: 0.000000, d: 0.488281, 
                  dx: 0.000000, dy: 0.000000, interp: bilinear
   2: Blur        radius: 5

ImageConfig:
   Width:          250
   Scale:          both
   File Type:      .png
   DpLimit:        3.00
   Blur:           5
   Prefilter str.: 0.50
   Flags:          dcmp-presize downscale-prefilter show-info 


RiapiImage::makeImage performance:
   ImageIO::readImage            20.1170 usec         20.1170 usec
   ImageConfig::compileProgram    5.8470 usec         25.9640 usec
   ImageIO::loadImage             5.5981 msec          5.6241 msec
   VipsProgram::makeImage        31.1868 msec         36.8108 msec
   ImageIO::storeImage           30.2749 msec         67.0858 msec
   Riapi::makeImage complete      2.3598 msec         69.4456 msec

How it works

RSZ.IO parses the URL, and figures out where to find the original image on your server, downloads the image and caches it. Then it applies the resize parameters to the image, runs an image conversion script on our servers, and caches the result. It works very much like a CDN.

RSZ.IO is extremely fast and can be used to resize and serve large numbers of images even for very high traffic web sites. You don't have to use it like you would kraken.io, where you cache and serve images on your own servers. We have the capacity to serve the images for you.

RSZI.IO will serve images that have already been downloaded and resized in under 5ms in most cases.

The very first time an image is served, rsz.io downloads the image from your site, so the total time will depend on the speed of your server plus the time to resize the image. Most resizing operations, even on very large images take less than 300ms. Subsequent resize operations, (e.g. the same image, but different parameters) will typically take between 50-300ms.

RSZ.IO uses libvips for the core of its image manipulation operations.

Stability and Capacity

RSZ.IO has had a total of about one hour of downtime in the last 112 days. This is 99.963% availability.

We process and serve about 66 million images per month.

Contact

E-Mail: rafael@rsz.io

RSZ.IO Documentation

Using RSZ.IO

RSZ.IO is an image resizing proxy that can resize images, change image formats, and manipulate images using many standard and advanced image processing techniques. Images from any web server can be manipulated using a simple RESTful api.

There are three ways to use RSZ.IO:

Method 1

Start with the url to any image hosted on a public http server, and add ".rsz.io" to the end of the domain domain name, and image resizing parameters at the end of the url. For example:

http://mydomain.com.rsz.io/images/photo.jpg?width=200

Method 2

Use a cname record pointed at RSZ.IO:

CNAME images.mydomain.com mydomain.com.rsz.io

to make this work on any domain that you control:

http://images.mydomain.com/images/photo.jpg?width=200

Method 3

Put our domain name in front of yours:

http://rsz.io/mydomain.com/images/photo.jpg?width=200

The advantage of this method is that you can also use https:

https://rsz.io/mydomain.com/images/photo.jpg?width=200

Because of limitations of SSL certificates (even wildcard certificates), only this this method will work with https.

Image Resizing

width or w

&width=200
&w=150
&width=75%

Constrains the size of the output image to a given width. The width can be specified in pixels, or as a percentage of the current width. Since the character % is a reserved character in urls, in practice you have to escape it as %25. If height is not specified, the resized image will maintain the original aspect ratio. If both height and width are specified, final image dimensions will depend on the resize mode.

height or h

&height=200
&h=640
&h=150%

Constrains the size of the output image to a given height. The height can be specified in pixels, or as a percentage of the current height. If width is not specified, the resized image will maintain the original aspect ratio. If both height and width are specified, final image dimensions will depend on the resize mode.

mode

&mode=max
&mode=pad

If both height and width are specified, mode will determine how the image is resized.

pad The image will be padded out with transparent pixels to become exactly the specified size while maintiaining aspect ratio. By default the padded out image will be centered, and the padding pixels will be white or transparent. The padding can be modified with the anchor parameter. The color of the padding pixels can be modified with the bgcolor parameter. This is the default.
max The image will be scaled to fit within the constraint box while maintaining aspect ratio. The output image is only guaranteed to equal one of the contraints. The other constraint will be smaller than or equal to the size specified.
crop The image will be cropped to match the required aspect ratio. The cropping will be even by default, but can be modified using the anchor, crop-hint-x and crop-hint-y parameters.
stretch The image will be stretched to fit the specified dimensions. This is the only mode where the image aspect ratio is not preserved.

scale

&scale=both
&scale=canvas

The scale mode constrains how upscaling is handled.

both Enables upscaling. This is the default.
down Disables upscaling. If any if the requested dimensions are larger than the current image, it will be treated as if that dimension was equal to the current image size.
canvas Enables upscaling of the image canvas, while keeping the image inside the same size. The canvas will be padded to the requested dimensions, and by the default the image will be centered. The position of the image can be modified with the anchor parameter. The color of the padding pixels can be modified with the bgcolor parameter.

anchor

&anchor=top-left
&anchor=center

Whenever padding is required this parameter controls how the contained image will be positioned. By default padding will be centered vertically and horizontally. This parameter only takes effect when &mode=pad, &mode=crop, or &scale=canvas.

top-left Image is justified to the top vertically, and left horizontally
top-center
top
Image is justified to the top vertically, and centered horizontally
top-right Image is justified to the top vertically, and right horizontally
middle-left
left
Image is centered vertically, and justified left horizontally.
middle-center
center
Image is centered vertically and horizontally.
middle-right
right
Image is centered vertically, and justified right horizontally.
bottom-left Image is justified to the bottom vertically, and left horizontally
bottom-center
bottom
Image is justified to the bottom vertically, and centered horizontally
bottom-right Image is justified to the bottom vertically, and right horizontally

crop-hint-x

&crop-hint-x=120
&crop-hint-x=50%

By default when cropping an image horizontally, an equal amount is cropped from left and right, leaving the cropped image centered. crop-hint-x specifies where to center the image when cropping horizontally. The crop hint can be a pixel offset on x, or it can be a percentage of the image width. The default setting is 50%, or an exact centering.

If crop-hint-x is set to 0 or 0%, the image is cropped from the right only. If it is set to the image width, or to 100%, the image is cropped from the left only. Normally the crop hint should be set to the horizontal offset of the most interesting part of the image, for example on the in the middle of the face in a portrait. When images are cropped to a tower aspect ratio, the center of the face will stay in the image.

crop-hint-x only takes effect when &mode=crop, and supercedes the anchor parameter.

crop-hint-y

&crop-hint-y=120
&crop-hint-y=50%

By default when cropping an image vertically, an equal amount is cropped from top and bottom, leaving the cropped image centered. crop-hint-y specifies where to center the image when cropping vertically. The crop hint can be a pixel offset on y, or it can be a percentage of the image height. The default setting is 50%, or an exact centering.

If crop-hint-y is set to 0 or 0%, the image is cropped from the bottom only. If it is set to the image height, or to 100%, the image is cropped from the top only. Normally the crop hint should be set to the vertical offset of the most interesting part of the image, for example on the horizon. When images are cropped to a banner aspect ratio, the horizon will stay in the image.

crop-hint-y only takes effect when &mode=crop, and supercedes the anchor parameter.

aspect

&aspect=1.33
&aspect=4:3

If one dimension of an image is specified, aspect can be used to specify the other dimension. It defines the desired ratio of image width to height. If both height and width are defined then aspect is ignored.

aspect can be specified either as a single floating point ratio, or as two integers, width then height, separated by a colon.

If client hints is active, then the specified with of an image can come from the client hints width header. In this way aspect can be used for dynamically sized responsive layouts.

ch-width

&ch-width=200

Sets the client hint width, when no client hint with header is provided. If width is set it will supercede both ch-width and the client hint width header. Setting ch-width will also set client-hints to true.

Whereas the client hint header is in pixels adjusted for DPR, the ch-width parameter is in screen pixels, like width. For example, on a device with DPR of 2, and a requested image width of 100px, the DPR header will be set by the browser to 200px, but the ch-width header should be set to the desired screen width or 100px.

Other Image Transformations

rotate

&rotate=45

Rotates an image prior to any resizing operation. The parameter is expressed in degrees. Any undefined areas in the rotated image will set set to transparent white. The undefined pixels can be set to any color using bgcolor.

srotate

&srotate=45

Rotates an image after any resizing operation. The parameter is expressed in degrees. Any undefined areas in the rotated image will set set to transparent white. The undefined pixels can be set to any color using bgcolor.

flip

&flip=x
&flip=xy
&flip=y

Flips an image vertically and/or horizontally prior to any resizing or rotation operation.

sflip

&flip=x
&flip=xy
&flip=y

Flips an image vertically and/or horizontally after any resizing or rotation operation.

affine

&affine=0.48,0,0,0.96,0,2
&affine=0.25,0,0,0.75,0,2,120,240,60,80

Applies an affine transformation to the image. All resize and rotation operations are subtypes of affine transformations. The affine option allows other tranformations such as adding skew, and tilt to images. It gives the user more direct control over exactly how to resize, rotate or crop images.

The affine option takes up to 10 parameters, in the following order: a, b, c, d, dx, dy, ow, oh, ox, oy. The transform is:

   X = a * ( x + dx ) + b * ( y + dy ) + ox
   Y = c * ( x + dx ) + d * ( y + dy ) + oy 
            

Where x and y are coordinates in the input image. X and Y are coordinates in the output image. X is evaluated from 0 to ow. Y is evaluated from 0 to oh.

By default ow, oh, ox and oy are set to cover the entire output image. Use these parameters only if you need to crop, pad or shift the output image. Think of these parameters as controlling the size and placement of the canvas.

The affine option will use the interpolator set by the interp option. Undefined pixels will be set according to the bgcolor option.

Transformation and Resampling Options

interp

&interp=nearest
&interp=bilinear

Sets the interpolation method used for all operations that involve resamping, including resizing, rotation and affine transformations. If no interpolator is specified, rsz.io will use nohalo.

nearest Sample using the nearest pixel. This is the fastest interpolator, but quality is poor. [ref]
bilinear Interpolate linearly between the four nearest pixels. Relatively fast and good quality. [ref]
bicubic Interpolate using cubic catmull-rom splines on a local patch of 4x4 pixels. Generally considered better quality than bilinear, but much more expensive to compute. [ref]
lbb Interpolate using the "Locally Bounded Bicubic" method. This is a variant of the classic bicubic catmull-rom interpolator but with much smaller halos. [ref]
nohalo Interpolate using the Nohalo level 1 interpolator. Similar in speed to the bicubic interpolator, but generally less noisy, and preserves edges better. Often resampled images benefit from a modest sharpening step after resizing. This is not usually necessary with nohalo. This is rsz.io default interpolator in most cases. [ref]
vsqbs Interpolate using Vertex-Split Quadratic B-Splines. Well suited for enlarging images, and is rsz.io's default interpolator for high enlargement ratios. ( 2x or more ) [ref]

colorspace

&colorspace=rgb
&colorspace=xyz
xyz The CIE 1931 XYZ color space coded as 3 floating point channels. The fourth channel is alpha (transparency). XYZ space is based on human perceptual experiments. Each of the channel represents the stimulation of the three types of cone cells in the eye. Not all combinations result in visible colors. Unlike colorspaces such as RGB, XYZ is device independent. [ref]
lab The CIE Lab color space coded as 3 floating point channels. The fourth channel is alpha (transparency). Lab space is a variant of the XYZ space. The first band, L, corresponds to luminance. This ranges from 0, minimum luminance ( e.g. black ) to 100, maximum luminance. The second band, a, is the ratio of red to green. It ranges from -128, most green, to +127 most red. The third band, b, is the ratio of yellow to blue. It ranges from -128, most blue, to +127 most blue. [ref]
labs The CIE Lab color space coded as 3 signed 16 bit integers. The fourth 16 bit channel is alpha (transparency).
lch The CIE LCh color space coded as 3 floating point channels. The fourth channel is alpha (transparency). CIE LCh is a cylindical encoding of the CIE Luv space. The first band L, is luminance. This ranges from 0, minimum luminance ( e.g. black ) to 100, maximum luminance. C and h are polar coordinates. The second band, c, is chroma or saturation. Zero is neutral gray, and 100 is the highest 'color purity'. The third band, h, is hue. It ranges from 0 to 360. Where 0 is red, 90 is yellow, 180 is green, and 270 is blue. [ref]
rgb The standard sRGB color space, represented as 4 floating point values, red, green, blue and alpha (transparency). Each channel ranges from 0 to 1. [ref]
scrgb The scRGB color space, but it allows values in the range of -0.5 to +7.5. scRGB encompases most of the CIE XYZ color space and can represent high dynamic range images. [ref]
rgb16 The RGB color space, represented as 4 16-bit values. This is the default representation for most image files.
grey16 A 16-bit grayscale repsentation.
yxy The CIE Yxy color space. This is a derivative of the CIE YXZ color space. The first channel x, is equal to X/(X+Y+Z) in the XYZ space. It ranges from 0 to 1. The second channel, y, is equal to Y/(X+Y+Z). The third channel, Y, is the unmodified Y channel from the XYZ space. [ref]

staged

&staged
&staged=true
&staged=false

If staged is set, when reducing the size of an image by a large multiple, the image is first reduced by an integer multiple using a box filter down to at least 1.5x the requested size, and then the rest of the way using an affine resize with an interpolator. This a fast way to create good quality thumbnail images.

There is no advantage to doing this when the image reader can decompress at reduced sizes ( as with dcmp-presize ), or when pre-filtering the image before reduction ( as with downscale-prefilter ). For large reductions it will generally be faster than using downscale-prefilter.

staged is false by default.

dcmp-presize

&dcmp-presize
&dcmp-presize=true
&dcmp-presize=false

Some image formats can be decoded to a size which is smaller than the full size image, generally by a fixed multiple. When dcmp-presize is true, and if the final resized image is much smaller than the original image, then the image will be decompressed at one of the smaller sizes, and resized to the exact dimensions from there. dcmp-presize is set by default.

dp-limit

&dp-limit=2.5

When dcmp-presize is set, this parameter will determine the minimum size of a decompressed image as a multiple of the requested image size. For example suppose an original image is 800 pixels wide, and the image reader supports decompressing that image to 400 and 200 pixels. The final requested image size is 100 pixels. If dp-limit is 3.0, then the minimum decompressed size is 300 pixels. Therefore the image will be decompressed at 400 pixels, and resized down from there. The default for this is 3.0.

When shrinking an image by very large multiples we may not need to process the entire fully decompressed image. But it is better that the image be some multiple larger than the final image size, so that the interpolators have data to work with.

downscale-prefilter

&downscale-prefilter
&downscale-prefilte=true
&downscale-prefilter=false

When shrinking an image it often helps to first blur the image. This removes some high frequency information that in the reduced image will look like "ringing". This parameter is on by default.

dpf-strength

&dpf-strength=0.75

When downscale-prefilter is set, this parameter determines the strength of the prefiltering, or blurring. A value of 1.0 will completely eliminate ringing, but may make the final image slightly soft. This is 0.5 by default.

This works by multiplying dpf-strength by the reduction ratio, rounding up to the nearest integer, and using that as the window size for a gaussian blur. For example, when shrinking from 300 pixels to 100 pixels, the reduction ratio is 3.0. With &dpf-strength=0.5, the window size will be 2.

bgcolor

&bgcolor=red
&bgcolor=8FA
&bgcolor=F0F0
&bgcolor=C0D080
&bgcolor=0DF37400

Some transformations leave undefined areas such as after a rotation, an affine transformation, or a resize using &mode=pad. bgcolor sets the background color used to fill in the undefined areas. By default this color is #FFF0, that is white with a fully transparent alpha channel. Image formats that support transparency, such as .png will be transparent in the undefined regions. Formats that don't, like .jpg will be white in these areas. The color may be set similarly to the way colors are defined in css:

red
cyan
black
Using the color names from the css specification. [ref]
F00
888
a3a
Using 3 hex digits (0-F) to represent the 3 4-bit channels of RGB.
F00F
8888
a3a3
Using 4 hex digits to represent the 4 4-bit channels of RGBA.
F00000
808080
a737a7
Using 6 hex digits. Each pair of digits represents one of the 3 8-bit channels of RGB.
F00000ff
80808080
a737a737
Using 8 hex digits. Each pair of digits represents one of the 4 8-bit channels of RGB.

File Format Options

format

&format=png
&format=webp

By default images are generated in the same format as the source image. The format parameter changes the format of the generated image.

jpg jpeg Generate as mime format image/jpeg
png Generate as mime format image/png
webp Generate as mime format image/webp
bmp Generate as mime format image/bmp
auto Automatically select the best format given the content of the client request's Accept header. Using this option will cause the response to Vary on Accept

quality

&quality=50
&quality=100

Some file formats, in particular .jpg and .webp can be saved at different quality levels. The quality parameter sets the quality level when saving to these file formats. This parameter ranges from 0 to 100, with 0 being the lowest quality, and highest compression ratio, and 100 being the highest quality and lowest compression ratio.

This parameter is defaults to 75.0 for both .jpg and .webp.

subsampling

&subsamping=444
&subsamping=gray

The subsampling option sets the chroma subsampling method used when writing .jpg files. The possible values are: 444, 422, 420, gray, 440. [ref]

Color Operations

blur

&blur=3

Do a gaussian blur of the image with a given window size. The parameter is an integer, and can range from 1 to higher. The larger the number the greater the blurring effect.

hist-norm

&hist-norm
&hist-norm=true

Perform histogram normalization on the image. This takes images that have a limited range of intensities and stretches those over the entire range of each channel. [ref]

hist-equal

&hist-equal
&hist-equal=3

Perform histogram equalization on the image. If a parameter is given, the filter will equalize all bands using values from the given band. If no parameter is given, all bands are equalized independently. This method will generally increase global contrast. It can greatly enhance detail in faded images, but will look somewhat unrealistic on most images. [ref]

sharpen

&sharpen
&sharpen=1,2,3
&sharpen=1,2,3,1.5,20,20

sharpen enhances edges in slighly soft images, making them appear sharper and crisper. It is a "smart-sharpening" filter. It operates in Lab color space, affectng only the L (luminance) channel. It can be useful after some resizing operations, since resampling can make images appear slightly blurry. By default our resizing operations use the nohalo interpolator and don't need sharpening by default. The default parameters do a good job of improving soft images in most cases. Sharpen takes up to 6 parameters:

flat strength The amount of sharpening in flat areas. Defaults to 1. Larger values will strengthen the sharpening in those areas.
jagged strength The amount of sharpening in high contrast, jagged areas. Defaults to 1. Larger values will strengthen the sharpening in those areas.
sharpening radius Radius of the sharpening filter. Defaults to 1. Larger values increase the sharpening effect.
flat threshold Defines the threshold between what areas are considered flat and jagged. Defaults to 1.5. Higher values and more of of the image will be considered flat.
brighten limit The amount any pixel is allowed to be lightened in order to sharpen the image. Defaults to 20. This is in CIE Luminance ( as defined in colorspaces like CIE Lab, CIE LCh ), that is in a range from 0 to 100.
darken limit The amount any pixel is allowed to be darkened in order to sharpen the image. Defaults to 50. This is in CIE Luminance ( as defined in colorspaces like CIE Lab, CIE LCh ), that is in a range from 0 to 100.

gamma

&gamma=1.5

Adjust the gamma of the image. For each channel in each pixel, calculate v = v ^ (1.0/gamma), and then normalize. A value of 1.0 leaves gamma unchanged.

LCh linear channel filters: The following three filter operations adjust the color of images in CIE LCh colorspace. In LCh colorspace: L is luminance, C is chroma, and h is hue. C and h are polar coordinates. C reprensents the amount of color. h ranges in degrees from 0 to 360, and represents the color itself. L is similar to brightness. Each of these parameters allow you to manipulate those channels independently. Each one takes up to two numbers, A and B to linearly scale one LCh channel: v = ( v * A ) + B; If A is not provided it defaults to 1.0, and B defaults to 0.0.

brightness

&luminance=1.5
&luminance=2,-50
&luminance=0.9,100

Linearly scale the luminance channel in LCh colorspace. The first number should be within the range of 0.0 to 3.0. Numbers greater than 1 will brighten the image, smaller ones will darken it. The second number should be within +-100. Positive numbers will brighten the image, negative numbers will darken it.

chroma

&chroma=0
&chroma=1.5
&chroma=0.75,25

Linearly scale the chroma channel in LCh colorspace. The first number should be within the range of 0.0 to 3.0. Numbers greater than one will make the image more colorful. Smaller numbers will make the colors muted. Setting this to 0 will turn the image into grayscale. The second number should be within +-100, positive numbers will make the image more colorful, negative numbers will mute the colors.

hue

&hue=5.5
&hue=0,180
&hue=-1,180

Linearly scale the hue channel in LCh colorspace. Changing these numbers will alter the colors, without changing the brighness or saturation of the image. Blues can become reds, yellows greens etc. Since the channel ranges in degrees from 0 to 360, adding or subtracting 360 will leave a hue unchanged. The maximum color change is 180.

color-matrix

&color-matrix=0.393,0.769,0.189,0.349,0.686,0.168,0.272,0.534,0.131
&color-matrix=-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,1,1,1,1,0
&color-matrix=hue=-0.33,0.59,0.11,0,0.33,0.59,0.11,0,0.33,0.59,0.11,0,0,0,0,0

Multiplies every pixel by a matrix. Pixels are always represented as 4 channels. The three channels of their color space, plus alpha. The default color space is RGBA. The color matrix maps the value in each channel to a new value based on a linear combination of all the channels.

The color-matrix option takes from 9, 16 or 20 floating point numbers that define a 3x3 matrix, a 4x4 matrix or a 4x5 matrix. color-matrix always operates using a 4x5 matrix. Smaller matrices are expanded with elements of an identity matrix to form the final 4x5 matrix. The identity matrix used for padding is:

     1 0 0 0
     0 1 0 0
     0 0 1 0
     0 0 0 1
     0 0 0 0
              
<<

The first 16 numbers form a 4x4 matrix is multiplied with each of the four elements of the pixel. The elements of the last row are added to each pixel element. Given ch[] is a four element vector representing the pixel, and m[] if the 4x5 matrix, the formula for the tranformation is:

     ch[0]   = ch[0] * m[0,0] + ch[1] * m[0,1] + ch[2] * m[0,2] + ch[3] * m[0,3] + m[4,0];
     ch[1]   = ch[0] * m[1,0] + ch[1] * m[1,1] + ch[2] * m[1,2] + ch[3] * m[1,3] + m[4,1];
     ch[2]   = ch[0] * m[2,0] + ch[1] * m[2,1] + ch[2] * m[2,2] + ch[3] * m[2,3] + m[4,2];
     ch[3]   = ch[0] * m[3,0] + ch[1] * m[3,1] + ch[2] * m[3,2] + ch[3] * m[3,3] + m[4,3];
              
<<

color-matrix operates in the RGBA color space by default, but it will operate in whatever color space is specified by the colorspace parameter. Many color filters like sepia, bw-photo, polaroid and invert are shortcuts for the color-matrix operation.

Color Filters

daltonize

&daltonize=sim-protanopia
&daltonize=adj-deuteranpia

The following six daltonization filters adjust images to make them more easier to understand for colorblind people. The most human eyes have 3 types of cone cells that respond to different frequencies of light energy. Most colorblindness is due to people who are missing one kind of cone cell, and cannot distiguish between color that differ in the light frequencies normally detected by that cell type.

In the following filters we map the colors from RGB, to Bradford cone space - a colorspace where each channel represents the light stimulation for each of three cone cell types. We can then simulate what an image would look like if we removed all information from one of the channels - e.g. everything that could be distinguished by cone cells of a certain kind. We can also "correct" these images by mapping the "error" due to the missing cones to the other cone channels. [ref]

The filters are:

sim-protanopia Simulate protanopia, a condition where the longest wavelength red/green cone cells are missing or function poorly. [ref]
sim-deuteranopia Simulate deuteranopia, a condition where the medium wavelength green/yellow cone cells are missing or function poorly. [ref]
sim-tritanopia Simulate tritanopia, a condition where the short wavelength blue/yellow cone cells are missing or function poorly. [ref]
adj-protanopia Adjust for protanopia.
adj-deuteranopia Adjust for deuteranopia.
adj-tritanopia Adjust for deuteranopia.

sepia

&sepia

Transform the image into an old fashioned sepia toned image. This is a shortcut for &color-matrix=0.393,0.769,0.189,0.349,0.686,0.168,0.272,0.534,0.131

bw-photo

&bw-photo

Transform the image to look like a black and white photo. This is a shortcut for &color-matrix=0.33,0.59,0.11,0.33,0.59,0.11,0.33,0.59,0.11

polaroid

&polaroid

Transform the image to simluate the limited color range of polariod film. This is a shortcut for &color-matrix=1.438,-0.122,-0.016,-0.062,1.378,-0.016,-0.062,-0.122,1.483

invert

&invert

Invert an image, making it look roughly like a color negative.This is a shortcut for &color-matrix=-1,0,0,0,0,-1,0,0,0,0,-1,0,0,0,0,1,1,1,1,0

Non-Image Options

prog-info

&prog-info
&prog-info=true
&prog-info=false

Process an image as normal, but instead of returning the generated image, return an html report that includes a detailed description of the operations performed, and performance information.

image-info

&image-info
&image-info=true
&image-info=false

Process an image as normal, but instead of returning the generated image, return json data giving some basic information about the image including the image dimensions, size, and format.

test-hash

&test-hash=57893
&test-hash=A4F62F0

Can be any string. All images are cached based on a hash of their parameters. If all image parameters are the same, the image file is not regenerated, but rather a cached version of the image is served. Use this parameter as a hash invalidator. Changing this will cause the image to be regenerated even if all the other parameters are the same as an existing image. Useful for performance testing only.

client-hints

&client-hints=true

Some browsers can be configured to send "client hints" that include the device pixel ratio, and the width of the image tag requesting the image. [ref] By default rsz.io does not read these headers. Setting client-hints to true will cause rsz.io to read these headers.

When in this mode:

  • dpr will be set from the client hints DPR header, if it has not been set as a url parameter.

  • The width of the image will be set from the client hints width header if possible and if it has not been set as a url parameter.
  • If width is not set, and there is no client hints width header then the width will be set from ch-width

Typical usage for this mode is to set the desired image aspect and rely on the client hints width header and dpr header to determine the final desired image size. The ch-width parameter should be set to a reasonable value to support clients that don't support client hints.