GET query arguments for modifying images with Photon. Also see Photon for more information.

Photon is only allowed to be used by sites hosted on WordPress.com, or on Jetpack-connected WordPress sites. If you move to another platform, or disconnect Jetpack from your site, please also switch to another magic image service. Abuse of Jetpack or violation of the WordPress.com Terms of Service could result in suspension of your site from WordPress.com-connected services.

Resource Description
GET?w= Set the width of an image in pixels.

http://i0.wp.com/s.ma.tt/files/2012/06/DSC01205.jpg?w=300

GET?h= Set the height of an image in pixels.

http://i0.wp.com/s.ma.tt/files/2012/06/MCM_0629-1600x1064.jpg?h=200

GET?crop=x,y,w,h Crop an image by percentages x-offset,y-offset,width,height (x,y,w,h). Percentages are used so that you don’t need to recalculate the cropping when transforming the image in other ways such as resizing it.Original image: 4-MCM_0830-1600×1064.jpgcrop=12,25,60,60 takes a 60% by 60% rectangle from the source image starting at 12% offset from the left and 25% offset from the top.

http://i0.wp.com/s.ma.tt/files/2012/06/4-MCM_0830-1600x1064.jpg?crop=12,25,60,60

crop=160px,160px,788px,788px takes a 788 by 788 square starting at 160 by 160.

http://i0.wp.com/s.ma.tt/files/2012/06/4-MCM_0830-1600x1064.jpg?crop=160px,160px,788px,788px

crop=160px,25,1400px,60 shows you can also mix the parameters types, for example a 1400 pixels by 60% rectangle from the image starting at 160 pixels by 25%.

http://i0.wp.com/s.ma.tt/files/2012/06/4-MCM_0830-1600x1064.jpg?crop=160px,25,1400px,60

GET?resize= Resize and crop an image to exact width,height pixel dimensions. Set the first number as close to the target size as possible and then crop the rest. Which direction it’s resized and cropped depends on the aspect ratios of the original image and the target size.

http://i0.wp.com/s.ma.tt/files/2012/06/9-DSC01406-1600x1066.jpg?resize=400,220

http://i0.wp.com/s.ma.tt/files/2010/11/MCM_4443.jpg?resize=200,400

This is useful for taking an image of any size and making it fit into a certain location while losing as little of the image as possible.

GET?fit= Fit an image to a containing box of width,height dimensions. Image aspect ratio is maintained.

http://i0.wp.com/s.ma.tt/files/2010/10/MCM_4049.jpg?fit=300,300

http://i0.wp.com/s.ma.tt/files/2010/10/MCM_4214.jpg?fit=300,300

For example, fit=100,100 on a landscape image with dimensions 400×300 will result in an image that is 100×75, while fit=100,100 on a portrait image with dimensions 300×400 will result in an image that is 75×100.

GET?lb= Add black letterboxing effect to images, by scaling them to width, height while maintaining the aspect ratio and filling the rest with black.

http://i0.wp.com/developer.files.wordpress.com/2013/03/letterboxing-example.jpg?lb=310,250

Original image

?lb=310,250

GET?ulb= Remove black letterboxing effect from images with ulb. This function takes only one argument, true.

http://i0.wp.com/developer.files.wordpress.com/2012/11/black-letterboxing-example.jpg?ulb=true

Original image

?ulb=true

GET?filter= The filter GET parameter is optional and is used to apply one of multiple filters. Valid values are: negate, grayscale, sepia, edgedetect, emboss, blurgaussian, blurselective, meanremoval.

Original image

filter=negate

filter=grayscale

filter=sepia

filter=edgedetect

filter=emboss

filter=blurgaussian

filter=blurselective

filter=meanremoval

GET?brightness= Adjust the brightness of an image. Valid values are -255 through 255 where -255 is black and 255 is white. Higher is brighter. The default is zero.brightness=-40 will darken an image by 40 and brightness=80will brighten an image by 80.

http://i0.wp.com/s.ma.tt/files/2011/06/MCM_9517-1600x1065.jpg?brightness=-40
http://i0.wp.com/s.ma.tt/files/2011/06/MCM_9517-1600x1065.jpg?brightness=0
http://i0.wp.com/s.ma.tt/files/2011/06/MCM_9517-1600x1065.jpg?brightness=80

brightness=-40

brightness=0

brightness=80

GET?contrast= Adjust the contrast contrast of an image. Valid values are -100 through 100. The default is zero.contrast=-50 will decrease contrast by 50 and contrast=50 will increase contrast by 50.

http://i0.wp.com/s.ma.tt/files/2011/06/MCM_9517-1600x1065.jpg?contrast=-50
http://i0.wp.com/s.ma.tt/files/2011/06/MCM_9517-1600x1065.jpg?contrast=0
http://i0.wp.com/s.ma.tt/files/2011/06/MCM_9517-1600x1065.jpg?contrast=50

contrast=-50

contrast=0

contrast=50

GET?colorize= Add color hues to an image with colorize by passing a comma separated list of red,green,blue (RGB) values such as 255,0,0 (red), 0,255,0 (green), 0,0,255 (blue).

http://i0.wp.com/s.ma.tt/files/2012/01/DSC00259.jpg?colorize=100,0,0
http://i0.wp.com/s.ma.tt/files/2012/01/DSC00259.jpg?colorize=0,100,0
http://i0.wp.com/s.ma.tt/files/2012/01/DSC00259.jpg?colorize=0,0,100

colorize=100,0,0

colorize=0,100,0

colorize=0,0,100

GET?smooth= The smooth parameter can be used to smooth out the image.

http://i0.wp.com/s.ma.tt/files/2011/06/MCM_9230-1600x1064.jpg?smooth=1

Original image

smooth=1

From the comments area of the PHP manual on the function: “Applies a 9-cell convolution matrix where center pixel has the weight arg1 and others weight of 1.0. The result is normalized by dividing the sum with arg1 + 8.0 (sum of the matrix). Any float is accepted, large value (in practice: 2048 or more) = no change”. Simply put, 0 appears to be maximum smoothing with higher numbers being less smoothing.

GET?zoom= Use zoom to size images for high pixel ratio devices and browsers when zoomed. Not available to use with crop. Zoom is intended for use by scripts such as devicepx.js which automatically set the zoom level. Valid zoom levels are 1, 1.5, 2-10.

http://i0.wp.com/s.ma.tt/files/2012/02/MCM_4246-1600x1064.jpg?w=310&zoom=2

Original image

zoom=2

GET?quality= Use the quality parameter to manage the quality output of JPEG and PNG images. Valid settings are between the values between 20 and 100. For JPEGs a setting of 100 will output the image at the original unaltered quality setting. However when specifying a quality of 100 for PNGs, the image is compressed using lossless compression and produces an image with identical quality as the original. Note that if the requesting web browser supports the WebP image format, then PNG and JPEG images will automatically be converted to the WebP image format by the server. When specifying 100 as the quality in this instance, a lossless compressed image will be produced, which in some instances may result in a file larger than the original.

Note that the default quality setting for JPEGs is 89%, PNGs 80%, and WebP images is 80%.

http://i0.wp.com/ma.tt/files/2014/09/8084136238_169f1ca1f0_o.jpg?w=310&quality=50

Original image

quality=50

GET?strip= Use the strip functionality to remove JPEG image Exif, IPTC, comment, and color data from the output image to reduce the image’s file size without having any visual data removed from the image. If orientation data is included in the Exif metadata, the image will be rotated accordingly.There are 3 valid settings for this parameter:

  • all: strips all extraneous data.
  • info: removes Exif, IPTC and comment data from the output image.
  • color: removes any ICC color profiles.
http://i0.wp.com/ma.tt/files/2012/06/13-MCM_0885.jpg?w=310&strip=all

Original image

strip=all