API Reference
Image URL API Reference
The Image URL API is the heart of the imgix service. By adding these parameters to your image URLs, you can enhance, resize and crop images, compress them and change format for better performance, create complex compositions, and extract useful metadata. These operations can be applied programmatically in real time across entire image libraries, removing the need to batch process or maintain multiple copies of an image to match device breakpoints.
This section of the documentation describes all of the parameters available in the imgix URL API and includes live examples that you can experiment with. For more detailed information about how to implement for specific use cases, please see the Tutorials section. To learn more about the basics of serving images once you’ve set up the service, read the Serving Images guide.
Base64 Variants
All imgix parameter values can be encoded using a URL-safe Base64 scheme. To use this approach, pre-encode the value, and append 64
to the end of the parameter name. For example, txt
becomes txt64
.
Please keep in mind that this uses the URL-safe alphabet as defined in RFC 4648.
Here’s an example:
?txt=Hello%2C%20World!
becomes the following when URL-safe Base64 encoded:
?txt64=SGVsbG8sIFdvcmxkIQ
Generating Base64-encoded parameters is easy in many languages. Here’s an example of how to do it in Ruby:
require "base64"
Base64.urlsafe_encode64("Hello, World!").delete('=')
#=> "SGVsbG8sIFdvcmxkIQ"
Many of the imgix client libraries automatically encode strings passed to Base64 variant parameters. Check whichever library you’re using for specific details of its implementation.
All Parameters (by Category)
Adjustment
-
bri
Brightness
-
con
Contrast
-
exp
Exposure
-
gam
Gamma
-
high
Highlight
-
hue
Hue
-
invert
Invert
-
sat
Saturation
-
shad
Shadow
-
sharp
Sharpen
-
usm
Unsharp Mask
-
usmrad
Unsharp Mask Radius
-
vib
Vibrance
Automatic
Background Color
Blending
-
blend
Blend
-
ba
Blend Align
-
balph
Blend Alpha
-
bc
Blend Crop
-
bf
Blend Fit
-
bh
Blend Height
-
bm
Blend Mode
-
bp
Blend Padding
-
bs
Blend Size
-
bw
Blend Width
-
bx
Blend X Position
-
by
Blend Y Position
Border & Padding
-
border
Border Size & Color
-
border-radius-inner
Inner Border Radius
-
border-radius
Outer Border Radius
-
pad
Padding
Color Palette
Device Pixel Ratio
Face Detection
Focal Point Crop
Format
-
chromasub
Chroma Subsampling
-
ch
Client Hints
-
colorquant
Color Quantization
-
cs
Color Space
-
dpi
Dots Per Inch
-
dl
Download
-
lossless
Lossless Compression
-
fm
Output Format
-
q
Output Quality
Mask Image
Noise Reduction
PDF Page Number
Rotation
Size
-
crop
Crop Mode
-
h
Image Height
-
w
Image Width
-
max-h
Maximum Height
-
max-w
Maximum Width
-
min-h
Minimum Height
-
min-w
Minimum Width
-
fit
Resize Fit Mode
-
rect
Source Rectangle Region
Stylize
Text
-
txtalign
Text Align
-
txtclip
Text Clipping Mode
-
txtclr
Text Color
-
txtfit
Text Fit Mode
-
txtfont
Text Font
-
txtsize
Text Font Size
-
txtlig
Text Ligatures
-
txtline
Text Outline
-
txtlineclr
Text Outline Color
-
txtpad
Text Padding
-
txtshad
Text Shadow
-
txt
Text String
-
txtwidth
Text Width
Trim
-
trimcolor
Trim Color
-
trim
Trim Image
-
trimmd
Trim Mean Difference
-
trimsd
Trim Standard Deviation
-
trimtol
Trim Tolerance