Transform images
Add transformations to your image policy to automate processes like cropping, rotating, resizing, and applying visual effects to your images. You can nest multiple transformations to achieve the desired result.
This guide provides the arguments to use when configuring image transformations with the policy image data source.
Overview
Image and Video Manager automatically applies a default policy named .auto with baseline settings that determine how to generate derivative images.
You can modify the default policy to select different image transformations, but you can't delete it. The preset values in the policy set the image quality at 85 and width values for derivative images at 720, 1080, 1366, 1920, and 5000 pixels.
Available transformations
| Transformation type | Transformation name | 
|---|---|
| To manipulate the size, shape, and orientation of your images. | append,aspect_crop,crop,face_crop,feature_crop,fit_and_fill,mirror,region_of_interest_crop,relative_crop,resize,rotate,scale,shear,smart_crop,trim | 
| To apply visual effects to your images. | background_color,blur,chroma_key,composite,contrast,goop,grayscale,hsl,hsv,max_colors,mono_hue,opacity,remove_color,unsharp_mask | 
You can apply a subset of transformations after applying image and quality settings (post-processing). This subset includes: background_color, blur, chroma_key, composite, compound, contrast, goop, grayscale, hsl, hsv, if_dimension, if_orientation, max_colors, mirror, mono_hue, opacity, remove_color, unsharp_mask.
For more information about the available image transformations, see Add image transformations and conditions.
Create or update an image policy
- Review the information in the Manage processing section to understand the basics about image transformation application and processing.
- Use the image policy data source to set up your transformations, building out the datablock with the transformation arguments.
- Set the output of the data source to a JSON file or use the output as a variable for the value of the jsonargument in the policy image resource.
Manage processing
Application of image effects occurs in both initial processing and post-production and on the areas within the break point of an image and outside.
- List the effects to apply to the image area inside the break point in the transformationsargument.
- Use the post_breakpoint_transformationsargument to list the effects to apply to the image area outside the break point.
You can use many Image and Video Manager arguments to specify a variable object instead of a string, number, or boolean value. See Use variables for details.
Organize
Define conditions to control and organize how to apply image transformations.
| Transformation | Description | 
|---|---|
| compound | Groups an ordered sequence of transformations together as a single transformation. | 
| if_dimension | Chooses a transformation depending on the dimensions of the source image. Contains: 
 | 
| if_orientation | Chooses a transformation depending on the orientation of the source image. Contains: 
 | 
| im_query | Applies artistic transformations on a per-image basis without having to create multiple policies by specifying transformations with a query string appended to the image URL. If used, all arguments are required. Contains: 
 | 
HCL
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      compound {
        transformations {
          aspect_crop {
            allow_expansion = false
            height          = 9
            width           = 8
            x_position      = 0.5
            y_position      = 0.5
          }
          contrast {
            brightness = 0.5
            contrast   = -0.3
          }
        }
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      if_dimension {
        value     = 2
        dimension = "height"
        greater_than {
          blur {
            sigma = 5
          }
        }
        less_than {
          composite {
            x_position = 0
            y_position = 0
            gravity    = "NorthWest"
            placement  = "Over"
            image {
              url_image {
                url = "www.example.com/image.jpg"
              }
            }
          }
        }
        equal {
          opacity {
            opacity = 1
          }
        }
        default {
          background_color {
            color = "#b75757"
          }
        }
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      if_orientation {
        landscape {
          background_color {
            color = "#6f2a2a"
          }
        }
        portrait {
          opacity {
            opacity = 0
          }
        }
        square {
          remove_color {
            color     = "#781c1c"
            tolerance = 0.2
            feather   = 1
          }
        }
        default {
          max_colors {
            colors = 3
          }
        }
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      im_query {
        query_var               = "imq"
        allowed_transformations = ["Append", "Blur"]
      }
    }
  }
}
JSON
{
  "transformations": [
    {
      "transformation": "Compound",
      "transformations": [
        {
          "transformation": "AspectCrop",
          "allowExpansion": false,
          "height": 9,
          "width": 8,
          "xPosition": 0.5,
          "yPosition": 0.5
        },
        {
          "transformation": "Contrast",
          "brightness": 0.5,
          "contrast": -0.3
        }
      ]
    }
  ]
}
{
  "transformations": [
    {
      "transformation": "IfDimension",
      "value": 2,
      "dimension": "height",
      "greaterThan": {
        "transformation": "Blur",
        "sigma": 5
      },
      "lessThan": {
        "transformation": "Composite",
        "xPosition": 0,
        "yPosition": 0,
        "gravity": "NorthWest",
        "placement": "Over",
        "image": {
          "url": "www.example.com/image.jpg"
        }
      },
      "equal": {
        "transformation": "Opacity",
        "opacity": 1
      },
      "default": {
        "transformation": "BackgroundColor",
        "color": "#b75757"
      }
    }
  ]
}
{
  "transformations": [
    {
      "transformation": "IfOrientation",
      "landscape": {
        "transformation": "BackgroundColor",
        "color": "#6f2a2a"
      },
      "portrait": {
        "transformation": "Opacity",
        "opacity": 0
      },
      "square": {
        "transformation": "RemoveColor",
        "color": "#781c1c",
        "tolerance": 0.2,
        "feather": 1
      },
      "default": {
        "transformation": "MaxColors",
        "colors": 3
      }
    }
  ]
}
{
  "transformations": [
    {
     "transformation": "ImQuery",
     "query": {
        "var": "imq"
      },
      "allowedTransformations": [
        "Append",
        "Blur"
      ]
    }
  ]
}
Manipulation
Cut or combine elements from multiple images to reduce size, direct focus, or create new images.
- All transformations are available for use during initial processing.
- A subset is available for use in post-processing to fine-tune and polish your images post-production.
Append
Use the append block with its child arguments to place a specified image beside the source image by a major dimension first and then on the minor.
Transparent pixels fill any area not covered by either image.
| Argument | Required | Description | 
|---|---|---|
| image | ✔ | The image type. Value is one of: 
 | 
| gravity | The placement of the imagerelative to the source image. The default centers the image. Value is one of:
 | |
| gravity_var | Use this argument instead of gravityif setting a variable. | |
| gravity_priority | Determines the exact placement of the imagewhengravityisCenteror a diagonal direction. Value is one of:
 | |
| gravity_priority_var | Use this argument instead of gravity_priorityif setting a variable. | |
| preserve_minor_dimension | Whether to preserve the source image's minor dimension. The default is false.
 | |
| preserve_minor_dimension_var | Use this argument instead of preserve_minor_dimensionif setting a variable. | 
HCL
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      append {
        image {
          box_image {
            color  = "#FFFFFF"
            width  = 9
            height = 7
          }
        }
        gravity          = "Center"
        gravity_priority = "horizontal"
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      append {
        image {
          circle_image {
            color    = "#FFFFFF"
            diameter = 5
          }
        }
        gravity          = "Center"
        gravity_priority = "horizontal"
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      append {
        image {
          text_image {
            fill        = "#000000"
            size        = 72
            stroke      = "#FFFFFF"
            stroke_size = 0
            text        = "Test"
            typeface    = "DejaVuSans"
          }
        }
        gravity          = "Center"
        gravity_priority = "horizontal"
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      append {
        image {
          url_image {
            url = "www.example.com/image.jpg"
          }
        }
        gravity          = "Center"
        gravity_priority = "horizontal"
      }
    }
  }
}
JSON
{
  "transformations": [
    {
      "transformation": "Append",
      "image": {
        "type": "Box",
        "color": "#FFFFFF",
        "width": 9,
        "height": 7
      },
      "gravity": "Center",
      "gravityPriority": "horizontal"
    }
  ]
}
{
  "transformations": [
    {
      "transformation": "Append",
      "image": {
        "type": "Circle",
        "color": "#FFFFFF",
        "diameter": 5
      },
      "gravity": "Center",
      "gravityPriority": "horizontal"
    }
  ]
}
{
  "transformations": [
    {
      "transformation": "Append",
      "image": {
        "type": "Text",
        "fill": "#000000",
        "size": 72,
        "stroke": "#FFFFFF",
        "strokeSize": 0,
        "text": "Test",
        "typeface": "DejaVuSans"
      },
      "gravity": "Center",
      "gravityPriority": "horizontal"
    }
  ]
}
{
  "transformations": [
    {
      "transformation": "Append",
      "image": {
        "type": "URL",
        "url": "www.example.com/image.jpg"
      },
      "gravity": "Center",
      "gravityPriority": "horizontal"
    }
  ]
}
Aspect crop
Use the aspect_crop block with its child arguments to change the height or width of an image's aspect ratio by either cropping or expanding the area.
All arguments are optional.
| Argument | Description | 
|---|---|
| allow_expansion | Increases the size of the image canvas to achieve the requested aspect ratio instead of cropping the image. | 
| allow_expansion_var | Use this argument instead of allow_expansionif setting a variable. | 
| height | The height of the aspect ratio to crop. | 
| height_var | Use this argument instead of heightif setting a variable. | 
| width | The width of the aspect ratio to crop. | 
| width_var | Use this argument instead of widthif setting a variable. | 
| x_position | The horizontal portion of the image you want to keep when applying aspect ratio cropping. If using allow_expansion, this setting defines the horizontal position of the image on the new expanded image canvas. | 
| x_position_var | Use this argument instead of x_positionif setting a variable. | 
| y_position | The horizontal portion of the image you want to keep when applying aspect ratio cropping. If using allow_expansion, this setting defines the horizontal position of the image on the new expanded image canvas. | 
| y_position_var | Use this argument instead of y_positionif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      aspect_crop {
        allow_expansion = false
        height          = 9
        width           = 8
        x_position      = 0.5
        y_position      = 0.5
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "AspectCrop",
      "allowExpansion": false,
      "height": 9,
      "width": 8,
      "xPosition": 0.5,
      "yPosition": 0.5
    }
  ]
}
Crop
Use the crop block with its child arguments to reduce the area of an image.
All arguments are optional.
| Argument | Description | 
|---|---|
| allow_expansion | If cropping an area outside of the existing canvas, expands the image canvas. If setting a variable for this argument, use varinside it instead of a direct value. | 
| allow_expansion_var | Use this argument instead of allow_expansionif setting a variable. | 
| gravity | The placement of the croprelative to the source image. The available values include eight cardinal directions (North,South,East,West,NorthEast,NorthWest,SouthEast,SouthWest) andCenterby default. | 
| gravity_var | Use this argument instead of gravityif setting a variable. | 
| height | The number of pixels to crop along the y-axis. | 
| height_var | Use this argument instead of heightif setting a variable. | 
| width | The number of pixels to crop along the x-axis. | 
| width_var | Use this argument instead of widthif setting a variable. | 
| x_position | The x-axis position to crop from. | 
| x_position_var | Use this argument instead of x_positionif setting a variable. | 
| y_position | The y-axis position to crop from. | 
| y_position_var | Use this argument instead of y_positionif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      crop {
        allow_expansion = false
        gravity         = "Center"
        height          = 9
        width           = 8
        x_position      = 0
        y_position      = 0
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "Crop",
      "allowExpansion": false,
      "gravity": "Center",
      "height": 9,
      "width": 8,
      "xPosition": 0,
      "yPosition": 0
    }
  ]
}
Face crop
Use the face_crop block with its child arguments to detect faces in the source image and apply the rectangular crop on either the biggest face or all of the faces detected.
Image and Video Manager tries to preserve faces in the image instead of using specified crop coordinates.
All arguments are optional.
| Argument | Description | 
|---|---|
| algorithm | Specifies the type of algorithm used to detect faces in the image. Options: 
 | 
| algorithm_var | Use this argument instead of algorithmif setting a variable. | 
| confidence | With algorithmset todnn, the minimum confidence needed to detect faces in the image. Values range from0to1for increased confidence, and possibly fewer faces detected. | 
| confidence_var | Use this argument instead of confidenceif setting a variable. | 
| fail_gravity | Controls placement of the crop if no faces are detected in the image. Directions are relative to the edges of the image being transformed. The available values represent the eight cardinal directions ( North,South,East,West,NorthEast,NorthWest,SouthEast,SouthWest) andCenterby default. | 
| fail_gravity_var | Use this argument instead of fail_gravityif setting a variable. | 
| focus | The focus of the crop rectangle, which is either around biggestFaceorallFaces. This isallby default. | 
| focus_var | Use this argument instead of focusif setting a variable. | 
| gravity | The placement of the crop relative to the faces, plus padding. The available values represent the eight cardinal directions ( North,South,East,West,NorthEast,NorthWest,SouthEast,SouthWest) andCenterby default. | 
| gravity_var | Use this argument instead of gravityif setting a variable. | 
| height | The height of the output image in pixels relative to the specified stylevalue. | 
| height_var | Use this argument instead of heightif setting a variable. | 
| padding | The padding ratio based on the dimensions of the biggest face detected, This is 0.5by default. Larger values increase padding. | 
| padding_var | Use this argument instead of paddingif setting a variable. | 
| style | To crop or scale a crop area for the faces detected in the source image. This is zoomby default. The output image is resized to the specifiedwidthandheightvalues. Value is one of:
 | 
| style_var | Use this argument instead of styleif setting a variable. | 
| width | The width of the output image in pixels relative to the specified stylevalue. | 
| width_var | Use this argument instead of widthif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      face_crop {
        algorithm    = "cascade"
        confidence   = 0.25
        fail_gravity = "SouthEast"
        focus        = "allFaces"
        gravity      = "Center"
        height       = 8
        padding      = 0.5
        style        = "fill"
        width        = 7
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "FaceCrop",
      "algorithm": "cascade",
      "confidence": 0.25,
      "failGravity": "SouthEast",
      "focus": "allFaces",
      "gravity": "Center",
      "height": 8,
      "padding": 0.5,
      "style": "fill",
      "width": 7
    }
  ]
}
Feature crop
Use the feature_crop block with its child arguments to identify prominent features of the source image to crop around relative to the specified width and height values.
All arguments are optional.
| Argument | Description | 
|---|---|
| fail_gravity | The placement of the crop if Image and Video Manager doesn't detect any features in the image. Directions are relative to the edges of the image being transformed. The available values represent the eight cardinal directions ( North,South,East,West,NorthEast,NorthWest,SouthEast,SouthWest) andCenterby default. | 
| fail_gravity_var | Use this argument instead of fail_gravityif setting a variable. | 
| feature_radius | The size in pixels of the important features to search for. If identified, two features never appear closer together than this value which is 8.0by default. | 
| feature_radius_var | Use this argument instead of feature_radiusif setting a variable. | 
| gravity | The placement of the crop relative to the region of interest plus padding. The available values represent the eight cardinal directions ( North,South,East,West,NorthEast,NorthWest,SouthEast,SouthWest) andCenterby default. | 
| gravity_var | Use this argument instead of gravityif setting a variable. | 
| height | The height in pixels of the output image relative to the specified stylevalue. | 
| height_var | Use this argument instead of heightif setting a variable. | 
| max_features | The maximum number of features to identify as important features. This maximum number of features is 32by default. The strongest features are always chosen. | 
| max_features_var | Use this argument instead of max_featuresif setting a variable. | 
| min_feature_quality | The minimum quality level of the feature identified. To be considered important, the feature needs to surpass this value. Image and Video Manager measures quality on a scale from 0(lowest) to1(highest). This is0.1by default. | 
| min_feature_quality_var | Use this argument instead of min_feature_qualityif setting a variable. | 
| padding | Adds space around the region of interest. The amount of padding added is directly related to the size of the bounding box of the selected features. Specifically, the region of interest is expanded in all directions by the largest dimension of the bounding box of the selected features multiplied by this value. | 
| padding_var | Use this argument instead of paddingif setting a variable. | 
| style | Specifies how to crop or scale a crop area for the features identified in the source image. This is fillby default. The output image resizes to the specifiedwidthandheightvalues. Value is one of:
 | 
| style_var | Use this argument instead of styleif setting a variable. | 
| width | The width in pixels of the output image relative to the specified stylevalue. | 
| width_var | Use this argument instead of widthif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      feature_crop {
        fail_gravity        = "Center"
        feature_radius      = 8
        gravity             = "Center"
        height              = 9
        max_features        = 32
        min_feature_quality = 0.1
        padding             = 0.05
        style               = "fill"
        width               = 7
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "FeatureCrop",
      "failGravity": "Center",
      "featureRadius": 8,
      "gravity": "Center",
      "height": 9,
      "maxFeatures": 32,
      "minFeatureQuality": 0.1,
      "padding": 0.05,
      "style": "fill",
      "width": 7
    }
  ]
}
Fit and fill
Use the fit_and_fill block with its child arguments to resize an image to fit within a specific size box and use a fill of that same image to cover any transparent space at the edges.
By default, the fill image has a blur transformation with a sigma value of 8 applied. You can use the fill_transformation argument to customize the transformation.
All arguments are optional.
| Argument | Description | 
|---|---|
| fill_transformation | Used to customize the sigma value for the fill image. | 
| height | The height value of the resized image. | 
| height_var | Use this argument instead of heightif setting a variable. | 
| width | The width value of the resized image. | 
| width_var | Use this argument instead of widthif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      fit_and_fill {
        fill_transformation {
          blur {
            sigma = 5
          }
        }
        height = 8
        width  = 7
      }
    }
  }
}
{
  "transformations" : [
    {
      "transformation" : "FitAndFill",
      "fillTransformation" : {
        "transformation" : "Blur",
        "sigma": 5
      },
      "height" : 8,
      "width" : 7
    }
  ]
}
Mirror
Use the mirror block with its child arguments to flip an image horizontally, vertically, or both.
All arguments are optional.
| Argument | Description | 
|---|---|
| horizontal | Flips the image horizontally. | 
| horizontal_var | Use this argument instead of horizontalif setting a variable. | 
| vertical | Flips the image vertically. | 
| vertical_var | Use this argument instead of verticalif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      mirror {
        horizontal = false
        vertical   = true
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "Mirror",
      "horizontal": false,
      "vertical": true
    }
  ]
}
Region of interest crop
Use the region_of_interest_crop block with its child arguments to crop around a specified area of interest (region) relative to the specified width and height values.
All arguments are optional.
| Argument | Required | Description | 
|---|---|---|
| region_of_interest | ✔ | The bounding shape of the important features to search for. Value is one of: 
 | 
| gravity | The placement of the crop area relative to the specified area of interest. The available values represent the eight cardinal directions ( North,South,East,West,NorthEast,NorthWest,SouthEast,SouthWest) andCenterby default. | |
| gravity_var | Use this value instead of gravityif setting a variable. | |
| height | The height in pixels of the output image relative to the specified stylevalue. | |
| height_var | Use this value instead of heightif setting a variable. | |
| style | Specifies how to crop or scale a crop area for the specified area of interest in the source image. The output image resizes to the specified widthandheightvalues. Value is one of:
 | |
| style_var | Use this value instead of styleif setting a variable. | |
| width | The width in pixels of the output image relative to the specified stylevalue. | |
| width_var | Use this value instead of widthif setting a variable. | 
HCL
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      region_of_interest_crop {
        region_of_interest {
          circle_shape {
            center {
              x = 2
              y = 1
            }
            radius = 3
          }
        }
        gravity = "Center"
        height  = 9
        style   = "fill"
        width   = 7
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      region_of_interest_crop {
        region_of_interest {
          point_shape {
            x = 3
            y = 3
          }
        }
        gravity = "Center"
        height  = 9
        style   = "fill"
        width   = 7
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      region_of_interest_crop {
        region_of_interest {
          polygon_shape {
            points {
              x = 2
              y = 2
            }
            points {
              x = 3
              y = 2
            }
          }
        }
        gravity = "Center"
        height  = 9
        style   = "fill"
        width   = 7
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      region_of_interest_crop {
        region_of_interest {
          rectangle_shape {
            anchor {
              x = 2
              y = 1
            }
            height = 3
            width = 2
          }
        }
        gravity = "Center"
        height  = 9
        style   = "fill"
        width   = 7
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      region_of_interest_crop {
        region_of_interest {
          union_shape {
            shapes {
              circle_shape {
                center {
                  x = 2
                  y = 1
                }
                radius = 3
              }
              rectangle_shape {
                anchor {
                  x = 3
                  y = 3
                }
                height = 3
                width  = 2
              }
            }
          }
        }
        gravity = "Center"
        height  = 9
        style   = "fill"
        width   = 7
      }
    }
  }
}
JSON
{
  "transformations": [
    {
      "transformation": "RegionOfInterestCrop",
      "regionOfInterest": {
        "center": {
          "x": 2,
          "y": 1
        },
        "radius": 3
      },
      "gravity": "Center",
      "height": 9,
      "style": "fill",
      "width": 7
    }
  ]
}
{
  "transformations": [
    {
      "transformation": "RegionOfInterestCrop",
      "regionOfInterest": {
        "x": 3,
        "y": 3
      },
      "gravity": "Center",
      "height": 9,
      "style": "fill",
      "width": 7
    }
  ]
}
{
  "transformations": [
    {
      "transformation": "RegionOfInterestCrop",
      "regionOfInterest": {
        "points": [
          {
            "x": 2,
            "y": 2
          },
          {
            "x": 3,
            "y": 2
          }
        ]
      },
      "gravity": "Center",
      "height": 9,
      "style": "fill",
      "width": 7
    }
  ]
}
{
  "transformations": [
    {
      "transformation": "RegionOfInterestCrop",
      "regionOfInterest": {
        "anchor": {
          "x": 2,
          "y": 1
        },
        "height": 3,
        "width": 2
      },
      "gravity": "Center",
      "height": 5,
      "width": 4,
      "style": "fill"
    }
  ]
}
 {
  "transformations": [
    {
      "transformation": "RegionOfInterestCrop",
      "regionOfInterest": {
        "shapes": [
          {
            "regionOfInterest": {
              "center": {
                "x": 2,
                "y": 1
              },
              "radius": 3
            }
          },
          {
            "regionOfInterest": {
              "anchor": {
                "x": 2,
                "y": 1
              },
              "height": 3,
              "width": 2
            }
          }
        ]
      },
      "gravity": "Center",
      "height": 9,
      "style": "fill",
      "width": 7
    }
  ]
}
Relative crop
Use the relative_crop block with its child arguments to shrink or expand an image relative to the image's specified dimensions.
- Transparent pixels fill any area not covered in the expanded areas.
- Positive values shrink the side.
- Negative values expand it.
All arguments are optional.
| Argument | Description | 
|---|---|
| east | The number of pixels to shrink or expand the right side of the image. | 
| east_var | Use this argument instead of eastif setting a variable. | 
| north | The number of pixels to shrink or expand the top side of the image. | 
| north_var | Use this argument instead of northif setting a variable. | 
| south | The number of pixels to shrink or expand the bottom side of the image. | 
| south_var | Use this argument instead of southif setting a variable. | 
| west | The number of pixels to shrink or expand the left side of the image. | 
| west_var | Use this argument instead of westif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      relative_crop {
        east  = 1
        north = 0
        south = 0
        west  = 1
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "RelativeCrop",
      "east": 1,
      "north": 0,
      "south": 0,
      "west": 1
    }
  ]
}
Resize
Use the resize block with its child arguments to resize an image to an absolute dimension.
This transformation uses the fit aspect preservation mode to select a value for the missing dimension that preserves the image's aspect unless you pass values for height and width.
All arguments are optional.
| Argument | Description | 
|---|---|
| aspect | Preserves the aspect ratio. Value is one of: 
 | 
| aspect_var | Use this argument instead of aspectis setting a variable. | 
| height | The height to which to resize the source image. Must be set if width is not specified. | 
| height_var | Use this argument instead of heightis setting a variable. | 
| type | The type of constraints on the image resize. Value is one of: 
 | 
| type_var | Use this argument instead of typeis setting a variable. | 
| width | The width to resize the source image to. Must be set if height is not specified. | 
| width_var | Use this argument instead of widthis setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      resize {
        aspect = "fit"
        height = 9
        type   = "normal"
        width  = 8
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "Resize",
      "aspect": "fit",
      "height": 9,
      "type": "normal",
      "width": 8
    }
  ]
}
Rotate
Use the rotate block with its child argument degrees to rotate an image around its center by the given degrees.
- Positive values rotate clockwise.
- Negative values rotate counter-clockwise.
If setting a variable for this argument, use degrees_var instead.
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      rotate {
        degrees = 2.5
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "Rotate",
      "degrees": 2.5
    }
  ]
}
Scale
Use the scale block with its child arguments to change the derivative image's dimensions relative to the original image’s.
All arguments are optional.
| Argument | Description | 
|---|---|
| height | The scaling factor for the input height used to determine the output height of the image. Image dimensions need to be non-zero positive numbers. 
 | 
| height_var | Use this argument instead of heightis setting a variable. | 
| width | The scaling factor for the input width used to determine the output width of the image. Image dimensions need to be non-zero positive numbers. 
 | 
| width_var | Use this argument instead of widthis setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      scale {
        height = 9
        width  = 8
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "Scale",
      "height": 9,
      "width": 8
    }
  ]
}
Shear
Use the shear block with its child arguments to slant an image into a parallelogram as a percent of the starting dimension in decimal format.
- Specify at least one axis argument.
- Transparent pixels fill empty areas around the sheared image as needed. To counter this, use the background_colortransformation for these areas.
All arguments are optional.
| Argument | Description | 
|---|---|
| x_shear | The amount to shear along the x-axis, measured in multiples of the image's width. Must be set if y_shearisn't specified. | 
| x_shear_var | Use this argument instead of x_shearis setting a variable. | 
| y_shear | The amount to shear along the y-axis, measured in multiples of the image's height. Must be set if x_shearisn't specified. | 
| y_shear_var | Use this argument instead of y_shearis setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      shear {
        x_shear = 2
        y_shear = 4
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "Shear",
      "xShear": 2,
      "yShear": 4
    }
  ]
}
Smart crop
Use the smart_crop block with its child arguments to crop around features in an area of interest relative to the given width and height values.
This transformation combines the capabilities of the face_crop and feature_crop transformations to automatically detect faces and pronounced features in an image.
- When smart_cropfinds more than one face, it crops around them, preserving as many complete faces as possible within the specified dimensions.
- If it doesn't find any faces, the crop is around the most prominent feature.
All arguments are optional.
| Argument | Description | 
|---|---|
| debug | Whether to execute the transformation. The default is false.
 | 
| debug_var | Use this value instead of debugif setting a variable. | 
| height | The height in pixels for an image relative to the stylevalue. | 
| height_var | Use this value instead of heightif setting a variable. | 
| sloppy | Whether to sacrifice any image fidelity for transformation performance. | 
| sloppy_var | Use this value instead of sloppyif setting a variable. | 
| style | Specifies how to crop or scale a crop area for an area of interest in the source image. Value is one of: 
 | 
| style_var | Use this value instead of styleif setting a variable. | 
| width | The width in pixels for an image relative to the stylevalue. | 
| width_var | Use this value instead of widthif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      smart_crop {
        debug  = false
        height = 9
        sloppy = false
        style  = "fill"
        width  = 8
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "SmartCrop",
      "debug": false,
      "height": 9,
      "sloppy": false,
      "style": "fill",
      "width": 8
    }
  ]
}
Trim
Use the trim block with its child arguments to automatically crop the background uniformly from the edges of an image.
All arguments are optional.
| Argument | Description | 
|---|---|
| fuzz | The fuzz tolerance of the trim expressed as a value between 0and1. This determines the acceptable amount of background variation before trimming stops. | 
| fuzz_var | Use this value instead of fuzzif setting a variable. | 
| padding | The amount of padding in pixels to add to the trimmed image. | 
| padding_var | Use this value instead of paddingif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      trim {
        fuzz    = 0.08
        padding = 1
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "Trim",
      "fuzz": 0.08,
      "padding": 1
    }
  ]
}
Visual effects
Improve the overall quality of your images.
- All transformations are available for use during initial processing.
- A subset is available for use in post-processing to fine-tune and polish your images post-production.
Background color
Use the background_color block with its child argument color to set the hexadecimal CSS color value for the background.
If setting a variable for this argument, use color_var instead.
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      background_color {
        color = "#FFFFFF"
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "BackgroundColor",
      "color": "#FFFFFF"
    }
  ]
}
Blur
Use the blur block with its child argument sigma to apply a Gaussian blur to a given value.
- The value of sigmascatters original pixels to create the blur effect.
- The resulting image may be larger than the original as some pixels may scatter outside the image's original dimensions.
If setting a variable for this argument, use sigma_var instead.
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      blur {
        sigma = 5
      }
    }
  }
}
{
  "transformations" : [
    {
      "transformation" : "FitAndFill",
      "fillTransformation" : {
        "transformation" : "Blur",
        "sigma": 5
      },
      "height" : 8,
      "width" : 7
    }
  ]
}
Chroma key
Use the chroma_key block with its child arguments to apply a green-screen technique and change any color in an image within the specified volume of the HSL colorspace to transparent or semitransparent.
All arguments are optional.
| Argument | Description | 
|---|---|
| hue_feather | How much additional hue to make semi-transparent beyond the hue_tolerance. The default is0.083which applies semi-transparency to hues 30 degrees around the Hue Tolerance. | 
| hue_feather_var | Use this argument instead of hue_featherif setting a variable. | 
| hue_tolerance | How close a color's hue needs to be to the selected hue for it to be changed to fully transparent. If you enter the maximum value of 1.0the entire image is made transparent. The default is approximately0.083or 8.3% of the color wheel. This value corresponds to 30 degrees around the specified hue. | 
| hue_tolerance_var | Use this argument instead of hue_toleranceif setting a variable. | 
| hue | The hue to remove. Enter the degrees of rotation (between 0 and 360) around the color wheel. By default chroma_keyremoves a green hue which is at 120 degrees on the color wheel. | 
| hue_var | Use this argument instead of hueif setting a variable. | 
| lightness_feather | How much additional lightness to make semi-transparent beyond the lightness_tolerance. The default value of0.1corresponds to 10% away from the tolerated lightness towards full black or full white. | 
| lightness_feather_var | Use this argument instead of lightness_featherif setting a variable. | 
| lightness_tolerance | How much of the lightest part and darkest part of a color to preserve. You can space this value out from the middle (for example, 0.5lightness or full color) to help preserve the splash lighting impact in the image. You can define how close the color needs to be to the full color to remove it from your image. The default value of0.75means that a color must be within 75% of the full color to full white or full black for full removal. | 
| lightness_tolerance_var | Use this argument instead of lightness_toleranceif setting a variable. | 
| saturation_feather | How much additional saturation to make semi-transparent beyond the saturation tolerance. The default is 0.1which applies semi-transparency to hues 10% below thesaturation_tolerance. | 
| saturation_feather_var | Use this argument instead of saturation_featherif setting a variable. | 
| saturation_tolerance | How close a color's saturation needs to be to full saturation for it to be fully transparent. For example, you can define how green the color needs to be to remove it from your image. The default value of 0.75means that a color must be within 75% of full saturation to be made fully transparent. | 
| saturation_tolerance_var | Use this argument instead of saturation_toleranceif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      chroma_key {
        hue                  = 120
        hue_feather          = 0.083
        hue_tolerance        = 0.083
        lightness_feather    = 0.1
        lightness_tolerance  = 0.75
        saturation_feather   = 0.1
        saturation_tolerance = 0.75
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "ChromaKey",
      "hue": 120,
      "hueFeather": 0.083,
      "hueTolerance": 0.083,
      "lightnessFeather": 0.1,
      "lightnessTolerance": 0.75,
      "saturationFeather": 0.1,
      "saturationTolerance": 0.75
    }
  ]
}
Composite
Use the composite block with its child arguments to apply another image to the source image as an overlay or underlay.
The image underneath is visible in areas that are beyond the edges of the top image or that are less than 100% opaque.
A common use of the overlay composite is to add a watermark.
| Argument | Required | Description | 
|---|---|---|
| image | ✔ | The image type. Value is one of: 
 | 
| gravity | The placement of the image relative to the source image. The available values include eight cardinal directions ( North,South,East,West,NorthEast,NorthWest,SouthEast,SouthWest) andCenterby default. | |
| gravity_var | Use this argument instead of gravityit setting a variable. | |
| placement | The placement of the applied image either on top of or underneath the base image. Watermarks are usually applied on top. Backgrounds are usually applied underneath. | |
| placement_var | Use this argument instead of placementit setting a variable. | |
| scale | A multiplier to resize the applied image relative to the source image while preserving the aspect ratio (1 by default). Set the scale_dimensionto calculate thescalefrom the source image's width or height. | |
| scale_var | Use this argument instead of scaleit setting a variable. | |
| scale_dimension | The dimension, either widthorheight, of the source image to scale. | |
| scale_dimension_var | Use this argument instead of scale_dimensionit setting a variable. | |
| x_position | The x-axis position of the image to apply. | |
| x_position_var | Use this argument instead of x_positionit setting a variable. | |
| y_position | The y-axis position of the image to apply. | |
| y_position_var | Use this argument instead of y_positionit setting a variable. | 
HCL
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      composite {
        image {
          box_image {
            color  = "#FFFFFF"
            width  = 9
            height = 7
          }
        }
        gravity         = "Center"
        placement       = "Over"
        scale           = 1
        scale_dimension = "width"
        x_position      = 1
        y_position      = 0
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      composite {
        image {
          circle_image {
            color    = "#FFFFFF"
            diameter = 2
            width    = 2
          }
        }
        gravity         = "Center"
        placement       = "Over"
        scale           = 1
        scale_dimension = "width"
        x_position      = 1
        y_position      = 0
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      composite {
        image {
          text_image {
            fill        = "#FFFFFF"
            size        = 72
            stroke      = "#000000"
            stroke_size = 1
            text        = "Test"
            typeface    = "DejaVuSans"
          }
        }
        gravity         = "Center"
        placement       = "Over"
        scale           = 1
        scale_dimension = "width"
        x_position      = 1
        y_position      = 0
      }
    }
  }
}
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      composite {
        image {
          url_image {
            url = "www.example.com/image.jpg"
          }
        }
        gravity         = "Center"
        placement       = "Over"
        scale           = 1
        scale_dimension = "width"
        x_position      = 1
        y_position      = 0
      }
    }
  }
}
JSON
{
  "transformations": [
    {
      "transformation": "Composite",
      "image": {
        "type": "Box",
        "color": "#FFFFFF",
        "height": 1,
        "width": 1
      },
      "gravity": "Center",
      "placement": "Over",
      "scale": 1,
      "scaleDimension": "width",
      "xPosition": 1,
      "yPosition": 0
    }
  ]
}
{
  "transformations": [
    {
      "transformation": "Composite",
      "image": {
        "type": "Circle",
        "color": "#FFFFFF",
        "diameter": 2,
        "width": 2
      },
      "gravity": "Center",
      "placement": "Over",
      "scale": 1,
      "scaleDimension": "width",
      "xPosition": 1,
      "yPosition": 0
    }
  ]
}
{
  "transformations": [
    {
      "transformation": "Composite",
      "image": {
        "type": "Text",
        "fill": "#FFFFFF",
        "size": 72,
        "stroke": "#000000",
        "strokeSize": 1,
        "text": "Test",
        "typeface": "DejaVuSans"
      },
      "gravity": "Center",
      "placement": "Over",
      "scale": 1,
      "scaleDimension": "width",
      "xPosition": 1,
      "yPosition": 0
    }
  ]
}
{
  "transformations": [
    {
      "transformation": "Composite",
      "image": {
        "url": "www.example.com/image.jpg"
      },
      "gravity": "Center",
      "placement": "Over",
      "scale": 1,
      "scaleDimension": "width",
      "xPosition": 1,
      "yPosition": 0
    }
  ]
}
Contrast
Use the contrast block with its child arguments to an image's contrast and brightness.
All arguments are optional.
| Argument | Description | 
|---|---|
| brightness | The brightness of the image. The acceptable value range is -1.0to1.0. Values outside of the acceptable range clamp to this range. Positive values increase brightness and negative values decrease brightness.
 | 
| brightness_var | Use this argument instead of brightnessif setting a variable. | 
| contrast | The contrast of the image. Expressed as a range from -1to1. Values outside of the-1to1range clamp to this range.
 | 
| contrast_var | Use this argument instead of contrastif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      contrast {
        brightness = 0.5
        contrast   = -0.3
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "Contrast",
      "brightness": 0.5,
      "contrast": -0.3
    }
  ]
}
Goop
Use the goop block with its child arguments to distort an image by randomly repositioning a set of control points along a specified grid. The transformed image appears goopy.
Adjust the density of the grid and the degree of randomness. You can use this transformation to create watermarks for use in security.
All arguments are optional.
| Argument | Description | 
|---|---|
| chaos | The greatest distance control points may move from their original position. 
 | 
| chaos_var | Use this argument instead of chaosif setting a variable. | 
| density | The density of control points used to distort the image. The largest dimension of the input image is divided up to fit this number of control points. A grid of points is extended on the smaller dimension such that each row and column of control points is equidistant from each adjacent row or column. This parameter strongly affects transformation performance. Be careful choosing values above the default if you expect to transform medium to large-sized images. | 
| density_var | Use this argument instead of densityif setting a variable. | 
| power | By default, the distortion algorithm relies on inverse squares to calculate distance but this allows you to change the exponent. You shouldn't need to vary the default value of 2.0. | 
| power_var | Use this argument instead of powerif setting a variable. | 
| seed | Your seed value as an alternative to the default, which is subject to variability. This allows for reproducible and deterministic distortions. If all parameters are kept equal and a constant seed is used, goopdistorts an input image consistently over many transformations. By default, this value is set to the current epoch time measured in milliseconds, which provides inconsistent transformation output. | 
| seed_var | Use this argument instead of seedif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      goop {
        chaos   = 0.25
        density = 4
        power   = 2
        seed    = 3
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "Goop",
      "chaos": 0.25,
      "density": 4,
      "power": 2,
      "seed": 3
    }
  ]
}
Grayscale
Use the grayscale block with its child argument type to restrict image color to shades of gray. The default value for type is Rec709. Supported values:
- Brightness
- Lightness
- Rec601
- Rec709
If setting a variable for this argument, use type_var instead.
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      grayscale {
        type = "Brightness"
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "Grayscale",
      "type": "Brightness"
    }
  ]
}
HSL
Use the hsl (Hue/Saturation/Lightness) block with its child arguments to adjust the hue, saturation, and lightness (HSL) of an image.
Notes:
HSL and HSV are similar. Where HSL's
lightnessattribute controls the vibrancy of a color, HSV'svalueattribute darkens a color.
Other transformations can also affect color, such as
grayscaleandmax_colors.
If you're using more than one of these transformations, consider the order of application for the desired results as the provided order is the processing order.
All arguments are optional.
| Argument | Description | 
|---|---|
| hue | The number of degrees to rotate colors around the color wheel. The default is 0. | 
| hue_var | Use this argument instead of hueif setting a variable. | 
| lightness | A multiplier to adjust the lightness of colors in the image. Note that lightness is distinct from brightness. For example, reducing the lightness of a light green might give you a lime green whereas reducing the brightness of a light green might give you a darker shade of the same green. 
 | 
| lightness_var | Use this argument instead of lightnessif setting a variable. | 
| saturation | A multiplier to adjust the saturation of colors in the image. 
 | 
| saturation_var | Use this argument instead of saturationif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      hsl {
        hue        = 0.1
        lightness  = 1.8
        saturation = 1.4
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "HSL",
      "hue": 0.1,
      "lightness": 1.8,
      "saturation": 1.4
    }
  ]
}
HSV
Use the hsv (Hue/Saturation/Value) block with its child arguments to adjust an image's hue, saturation, and value (HSV).
Notes:
HSL and HSV are similar. Where HSL's
lightnessattribute controls the vibrancy of a color, HSV'svalueattribute darkens a color.
Other transformations can also affect color, such as
grayscaleandmax_colors.
All arguments are optional.
| Argument | Description | 
|---|---|
| hue | The number of degrees to rotate colors around the color wheel. This is 0.0by default. | 
| hue_var | Use this argument instead of hueif setting a variable. | 
| saturation | A multiplier to adjust the saturation of colors in the image. 
 | 
| saturation_var | Use this argument instead of saturationif setting a variable. | 
| value | A multiplier to adjust the lightness or darkness of the image's base color. 
 | 
| value_var | Use this argument instead of valueif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      hsv {
        hue        = 0.2
        saturation = 1.5
        value      = 0.8
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "HSV",
      "hue": 0.2,
      "saturation": 1.5,
      "value": 0.8
    }
  ]
}
Max colors
Use the max_colors block with its child argument colors to set the maximum number of colors in an image’s palette. The fewer colors used, the smaller the file size.
If setting a variable for this argument, use colors_var instead.
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      max_colors {
        colors = 5
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "MaxColors",
      "colors": 5
    }
  ]
}
Mono hue
Use the mono_hue block with its child argument hue to set all hues in an image to a single hue represented by its number on the color wheel, 0–360.
mono_hue maintains the original color’s lightness and saturation but sets the hue according to the specified value. This makes the image various shades of the specified hue.
If setting a variable for this argument, use hue_var instead.
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      mono_hue {
        hue = 50
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "MonoHue",
      "hue": 50
    }
  ]
}
Opacity
The opacity argument sets the level of transparency for an image represented as a value on a scale of 0 to 1.
- An image with no transparency is opaque.
- Values below 1decrease opacity.
- A value of 0makes an image completely transparent.
If setting a variable for this argument, use opacity_var instead.
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      opacity {
        opacity = 0.8
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "Opacity",
      "opacity": 0.8
    }
  ]
}
Remove color
Use the remove_color block with its child arguments to remove a specified color from an image and replace it with transparent pixels.
All arguments are optional.
| Argument | Description | 
|---|---|
| color | The hexadecimal CSS color value to remove. | 
| color_var | Use this argument instead of colorif setting a variable. | 
| feather | Used to minimize any hard edges and to make the color removal more gradual in appearance. This option allows you to extend the color removal beyond the specified tolerance. The pixels in this extended tolerance become semi-transparent which creates a softer edge. The first time there’s a real-time request for an image, this option may result in a slow transformation time, but subsequent requests aren't impacted as the transformed image is served directly from the cache. | 
| feather_var | Use this argument instead of featherif setting a variable. | 
| tolerance | How close the color needs to be to the selected color before it's changed to fully transparent. Set to 0.0to remove only the exact color specified. | 
| tolerance_var | Use this argument instead of toleranceif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      remove_color {
        color     = "#FFFFFF"
        feather   = 0.2
        tolerance = 0.2
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "RemoveColor",
      "color": "#FFFFFF",
      "feather": 0.2,
      "tolerance": 0.2
    }
  ]
}
Unsharp mask
Use the unsharp_mask block with its child arguments to emphasize edges and details in source images without distorting the colors.
Although this effect is often referred to as sharpening an image, it actually creates a blurred, inverted copy of the image known as an unsharp mask. Image and Video Manager combines the unsharp mask with the source image to create an image that is perceived by the human eye as clearer.
All arguments are optional.
| Argument | Description | 
|---|---|
| gain | How much emphasis the filter applies to details. Higher values increase the apparent sharpness of details. | 
| gain_var | Use this argument instead of gainif setting a variable. | 
| sigma | The standard deviation of the Gaussian distribution used in the unsharp mask, measured in pixels. This is 1.0by default. High values emphasize large details and low values emphasize small details. | 
| sigma_var | Use this argument instead of sigmaif setting a variable. | 
| threshold | The minimum change required to include a detail in the filter. Higher values discard more changes. | 
| threshold_var | Use this argument instead of thresholdif setting a variable. | 
data "akamai_imaging_policy_image" "my-image-policy" {
  policy {
    transformations {
      unsharp_mask {
        gain      = 1
        sigma     = 1
        threshold = 0.05
      }
    }
  }
}
{
  "transformations": [
    {
      "transformation": "UnsharpMask",
      "gain": 1,
      "sigma": 1,
      "threshold": 0.05
    }
  ]
}
Image types
You can, and in some cases may be required to, specify these image types for certain transformations:
| Image type | Subarguments | 
|---|---|
| box_image | A rectangular box with a specified fill color and applied transformation. Options: 
 | 
| circle_image | A simple, solid, monochrome circle of a specified diameter on a transparent background. Options: 
 | 
| text_image | A snippet of text. Defines font family and size, fill color as well as outline stroke width and color. Options: 
 | 
| url_image | An image loaded from a URL. Options: 
 | 
Shape types
You can, and in some cases may be required to, specify these shape types for certain transformations:
| Shape type | Subarguments | 
|---|---|
| circle_shape | Defines a circle with a specified radiusfrom itscenterpoint. Contains:
 | 
| point_shape | Defines coordinates for a single point to help define polygons and rectangles. Each point may be an object with x and y members, or a two-element array. Contains: 
 | 
| polygon_shape | Defines a polygon from a series of connected points. Contains a required pointsargument that lists a series ofpoint_shapeobjects. The last and first points connect to close the shape automatically. | 
| rectangle_shape | Defines a rectangle's widthandheightrelative to ananchorpoint at the top left corner. Contains:
 | 
| union_shape | Identifies a shape based on a combination of other shapes. Contains an array of shapesthat form the union. | 
Updated 5 months ago
