Skip to content

Image transformations

uHeadless’ built-in image transformation service allows to generate images optimized and resized dynamicly on the edge.

Once image transformations has been enabled on your uHeadless project you can start using image transformations. You need to proxy your images through the media.uheadless.com service.

<img src="https://media.uheadless.com/<id>/media/0mxpkjq4/mkl_selskabslokale_vinter-2024_9.jpg?w=1280" />

This documentation covers the URL search parameters that can be used to configure image transformations.

Sets the width of the output image in pixels

?w=800

Sets the height of the output image in pixels

?h=600

Sets the quality/compression level of the output image

?q=85 // (1-100)

Determines how the image should be resized to fit the specified dimensions

ValuesDescription
clipScales to fit within dimensions
cropScales and crops to fill dimensions
scaleOnly scales down, never up
?fit=crop

X-coordinate of the focal point for cropping operations

Must be used together with fp-y

?fp-x=0.5 // (0-1)

Y-coordinate of the focal point for cropping operations Must be used together with fp-x

?fp-y=0.3 // (0-1)

Rotates the image by the specified number of degrees

?rot=90

Converts the image to the specified format

ValuesDescription
avifConverts to avif
jpgConverts to jpeg
pngConverts to png
webpConverts to webp

Sets the background color for transparent areas (useful for format conversions)

?bg=ffffff

Applies a blur effect to the image

?blur=5

Adjusts the brightness of the image

?bri=10

Adjusts the contrast of the image

?con=15

Applies a sharpening effect to the image

?sharp=3

Crops the image to a specific rectangle defined by left, top, width, height

?rect=80,272,2880,1620
# Basic resize with quality
?w=800&h=600&q=85
# Crop with focal point
?w=400&h=300&fit=crop&fp-x=0.3&fp-y=0.7
# Format conversion with background
?fm=jpeg&bg=ffffff
# Multiple effects
?w=500&blur=2&bri=10&con=5&sharp=1
# Rectangle crop with rotation
?rect=100,50,800,600&rot=90