Supported operations

This section lists the operations supported by Cloud CDN image optimization. The table includes parameters, such as operation, syntax, attributes, description and examples, which helps you create your imop query.

Cloud CDN image optimization supports a set of operations that let you transform your images, such as resize, crop and scale. Each operation has its own syntax, supported attributes and constraints.

This page lists the operations supported by Cloud CDN image optimization with examples that help you create your imop query.

Operation Syntax and example Attributes Description

Resize

?imop=Resize,width=<resized_width>,height=<resized_height>

https://www.example.com/image.jpg?imop=Resize,width=250,height=125

  • width type: Integer (Range: 1–8192)
  • height type: Integer (Range: 1–8192)

The maximum width × height can't exceed 67 mpx (67,108,864 pixels).

  • scaling (optional) type: enum, values: proportional, stretch.

By default, this operation preserves the aspect ratio and enforces a downscale-only strategy. When you specify both width and height without scaling=stretch, Cloud CDN image optimization fits the image proportionally within the specified bounds. If you omit either dimension, Cloud CDN calculates the other to maintain the aspect ratio.

Both the proportional and stretch values enable upscaling. The proportional value maintains the aspect ratio, whereas the stretch value ignores the aspect ratio and resizes the image to the exact dimensions (downscaling or upscaling) and requires you to specify both the width and height parameters.

Scale

?imop=Scale,ratio=<scale_ratio>

https://www.example.com/image.jpg?imop=Scale,ratio=0.5

ratio
  • Type: Float (limited to 2 decimal digits)
  • Constraint: 0 < value ≤ 1

This operation scales the image by a specific factor and enforces downscaling only. If Scale is used, it must be specified as the first operation. Mutually exclusive with Resize and Crop operations.

If you include the Scale operation with the Resize or Crop operations within a single request, the system returns an error.

Crop

?imop=Crop,shape=<shape>,left=<left>,right=<right>,top=<top>,bottom=<bottom>,snap_to_x=<snap_x>,snap_to_y=<snap_y>

https://www.example.com/image.jpg?imop=Crop,shape=rectangle,left=0.5,snap_to_x=512

shape
  • Type: String (rectangle, circle)
  • Default: rectangle
  • Dependency: must be used with the crop parameter. Invalid value will return HTTP 400.
left, right, top, bottom
  • Type: Float
  • Range: 0.0 to 1.0, max 3 decimal places
  • Default: 0.0, 1.0, 0.0, 1.0
  • Constraint: mandatory to include at least one of: left, right, top, bottom.
snap_to_x, snap_to_y
  • Type: Integer
  • Range: 0 or greater
  • Default: 0

This operation crops the image based on regional markers. If you specify an invalid value for the shape parameter, the system returns an HTTP 400 Bad Request.

The crop coordinates automatically snap to the nearest multiple of the specified snap_to_x or snap_to_y value.

Canvas

?imop=Canvas,width=<canvas_width>,height=<canva_height>,background_color=<color>,gravity=<gravity>

https://www.example.com/image.jpg?imop=Canvas,width=250,height=125,background_color=FFF,gravity=center

width, height
  • Type: Integer
  • Range: 1–8192
  • Max width x height cannot exceed 67,108,864 pixels.
gravity
  • Type: String
  • Values: center, left, right, top, bottom, top_left, top_right, bottom_left, bottom_right
  • Default: center
background_color
  • Type: String
  • Format: 3-digit (for example, FFF), 4-digit (for example, FFFF), or 6-digit (for example, FFFFFF) hex codes
  • Default: 000000 (black).

This operation enhances images by adding a background layout of specified dimensions and color. If you use the Canvas operation, you must specify it as the last operation, and it is always executed last. The gravity parameter dictates the placement of the inner image on this background canvas.

Note: Canvas operations don't preserve C2PA Content Credentials. The transformation still succeeds fail-open, but the output image omits any C2PA manifest.

Rotate

?imop=Rotate,degrees=<rotate_degrees>

https://www.example.com/image.jpg?imop=Rotate,degrees=90

degrees
  • Type: Integer
  • Allowed values: 90, 180, 270.

This operation rotates the target image clockwise.

Mirror

?imop=Mirror,flip=<flip>

https://www.example.com/image.jpg?imop=Mirror,flip=h

flip
  • Type: String
  • Allowed values: h (horizontal), v (vertical), hv (horizontal & vertical).

This operation mirrors the image either horizontally, vertically, or both.

Compress

?imop=Compress,strength=<value>

https://www.example.com/image.jpg?imop=Compress,strength=medium

strength
  • Type: String
  • Allowed values: very_weak, weak, medium, strong, very_strong.
  • Constraint: supported only for jpeg, avif, and webp. Values outside this range return HTTP 400.
  • Mutual exclusivity: Mutually exclusive with the Quality operation. If you specify both operations in the same request, Cloud CDN returns an HTTP 400 Bad Request status code.

This operation compresses the image by decreasing the target image quality. The strength parameter lets you control the active image compression level using preset tiers.

Quality

?imop=Quality,level=<quality_level>

https://www.example.com/image.jpg?imop=Quality,level=85

level
  • Type: Integer
  • Range: 1 to 100
  • Supported formats: jpeg, webp, avif. Values outside this range return HTTP 400.
  • Mutual exclusivity: Mutually exclusive with the Compress operation. If you specify both operations in the same request, Cloud CDN returns an HTTP 400 Bad Request status code.

This operation adjusts image compression using a fine-grained numeric quality scale. On this scale, 1 represents the lowest visual quality and smallest file size, and 100 represents the highest visual quality and largest file size.

Convert

?imop=Convert,format=<format>

https://www.example.com/image.jpg?imop=Convert,format=webp

format
  • Type: String.
  • Allowed values: jpeg, png, webp, avif, gif
  • Constraint: Any other unlisted value will result in a processing error.

This operation changes the final delivery format of the image. If there is a processing conflict with the browser's incoming ACCEPT header specification, the system returns an HTTP 406 Not Acceptable error.

Metadata

?imop=Metadata,preserve=<preserve>

https://www.example.com/image.jpg?imop=Metadata,preserve=none

preserve
  • Type: String
  • Allowed values: none, copyright, max, c2pa
  • Default: copyright

This operation controls how image metadata and Content Credentials properties are handled during execution:

copyright (default): keeps only Author, Copyright, and Caption fields, and preserves and updates any valid C2PA Content Credentials manifest.

c2pa: strips standard EXIF, IPTC, and XMP metadata while preserving and updating only the C2PA Content Credentials manifest.

max: preserves all fields, including C2PA Content Credentials, except EXIF orientation and color profiles which are applied on the transformation.

none: removes all metadata properties, including EXIF, IPTC, XMP, copyright, and C2PA Content Credentials manifests.

Tone

?imop=tone,brightness=<brightness>,contrast=<contrast_level>,saturation=<saturation>

https://www.example.com/image.jpg?imop=tone,brightness=50,contrast=50,saturation=50

  • brightness
    • Type: Integer
    • Range: -100 to 100
  • contrast
    • Type: Integer
    • Range: -100 to 100
  • saturation
    • Type: Integer
    • Range: -100 to 100

This operation dynamically modifies the brightness, contrast, and saturation levels of an image. If you omit a specific parameter or set to 0, the system doesn't change that attribute. Setting saturation to -100 forces grayscale conversion.

Constraint: at least one of brightness, contrast, or saturation is required. Specifying Tone without attributes returns an HTTP 400 Bad Request status code.

Sharpen

?imop=Sharpen,strength=<sharpness>

https://www.example.com/image.jpg?imop=Sharpen,strength=50

strength
  • Type: Integer
  • Range: 0 to 100

This operation increases the sharpness of the image.

Blur

?imop=Blur,strength=<blur_size>

https://www.example.com/image.jpg?imop=Blur,strength=50

strength
  • Type: Integer
  • Range: 0 to 100

This operation applies a localized blur filter across the image.

Note: Blur operations don't preserve C2PA Content Credentials. The transformation still succeeds fail-open, but the output image omits any C2PA manifest.

Freeze

?imop=freeze,frame=<frame>

https://www.example.com/image.gif?imop=freeze,frame=0

frame
  • Type: Integer
  • Range: 0 to 100.

This operation extracts a single, static frame from an animated image sequence, such as an animated GIF. The frame parameter specifies the exact frame index to extract.

What's next