Resize and convert images with Cloudflare

Serve resized, cropped and converted images in IXO client apps with Cloudflare Image transformations on ixo.world: URL format, parameters and limits.

IXO client applications serve images through Cloudflare Image transformations on the ixo.world domain. Instead of storing several sizes of each image, you write the size, crop, quality and format into the image URL, and the image is transformed when it is requested. Use this page to build those URLs: the format, the parameters, responsive images, the limits and what to check when an image does not load.

Configuration

SettingValue
Domainixo.world
Allowed originsipfs.gateway.ixo.world

Build an image URL

Transform an image with this URL format:

https://ixo.world/cdn-cgi/image/[OPTIONS]/[SOURCE-IMAGE-CID]

For example, an image 300 pixels wide at quality 80:

https://ixo.world/cdn-cgi/image/width=300,quality=80/[SOURCE-IMAGE-CID]

Responsive images

Using width=auto

width=auto picks the image size that suits the device:

https://ixo.world/cdn-cgi/image/width=auto/[SOURCE-IMAGE-CID]
SizeDevice
320pxMobile
640pxTablet
960pxLaptop
1920pxDesktop
<img
  srcset="
    https://ixo.world/cdn-cgi/image/width=640/[SOURCE-IMAGE-CID]   640w,
    https://ixo.world/cdn-cgi/image/width=960/[SOURCE-IMAGE-CID]   960w,
    https://ixo.world/cdn-cgi/image/width=1920/[SOURCE-IMAGE-CID] 1920w
  "
  sizes="(max-width: 767px) 640px,
         (max-width: 1023px) 960px,
         1920px"
  src="https://ixo.world/cdn-cgi/image/width=960/[SOURCE-IMAGE-CID]"
  alt="Responsive image"
/>

Parameters

Resizing

ParameterWhat it setsExample
widthImage width in pixelswidth=300
heightImage height in pixelsheight=200
fitResizing methodfit=cover
gravityFocus point when croppinggravity=auto

Fit options

ValueWhat it does
scale-downResize to fit within the dimensions, never enlarge
containResize to fit within the dimensions, preserving the aspect ratio
coverResize and crop to fill the dimensions
cropCrop without scaling
padResize and add padding to match the dimensions

Quality and format

ParameterWhat it setsExample
qualityJPEG/WebP quality (1-100)quality=80
formatOutput image formatformat=auto
sharpenSharpen level (0.0-10.0)sharpen=1.0

Format options

ValueWhat it returns
autoThe best format for the browser
webpWebP format
avifAVIF format
jsonThe image metadata

Limits

LimitValue
Maximum image area100 megapixels
Maximum GIF/WebP animation50 megapixels
Maximum file size70 MB
AVIF formatLimited to 1,600 pixels max
HEIC/HEIF formatsNot supported

Security

  • Only images from the allowed origins can be transformed. The source image URL must be on an allowed origin.
  • SVG files are sanitized automatically.

Examples

Thumbnail

https://ixo.world/cdn-cgi/image/width=150,height=150,fit=cover,gravity=auto/[SOURCE-IMAGE-CID]

Responsive profile image

https://ixo.world/cdn-cgi/image/width=auto,fit=cover,gravity=auto/[SOURCE-IMAGE-CID]

Optimized banner

https://ixo.world/cdn-cgi/image/width=1200,height=400,fit=cover,quality=80,format=auto/[SOURCE-IMAGE-CID]

High-DPI image

https://ixo.world/cdn-cgi/image/width=600,dpr=2,quality=75/[SOURCE-IMAGE-CID]

When an image does not load

  1. Check that the source URL is on an allowed origin.
  2. Check that the image exists at the source URL.
  3. Check that the transformation parameters are formatted correctly.
  4. Check that the image is within the limits.

Next steps