Transform images
Add transformations to your image policy to automate processes like cropping, rotating, resizing, and applying visual effects to your images.
Overview
When creating a policy set, Image and Video Manager automatically applies a default .auto
policy. This policy has baseline settings that determine how to generate derivative images. If a request includes the -DefaultPolicy
parameter, you can specify a custom policy instead of using the default policy settings.
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 , AspectCrop , Crop , FaceCrop , FeatureCrop , FitAndFill , Mirror , RegionOfInterestCrop , RelativeCrop , Resize , Rotate , Scale , Shear , Trim |
To apply visual effects to your images. | BackgroundColor , Blur , ChromaKey , Composite , Contrast , Goop , Grayscale , HSL , HSV , MaxColors , MonoHue , Opacity , RemoveColor , UnsharpMask |
You can apply a subset of transformations after applying image and quality settings (post-processing). This subset includes: BackgroundColor
, Blur
, ChromaKey
, Composite
, Compound
, Contrast
, Goop
, Grayscale
, HSL
, HSV
, IfDimension
, IfOrientation
, MaxColors
, Mirror
, MonoHue
, Opacity
, RemoveColor
, UnsharpMask
.
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 Managing processing section to understand the basics of image transformation application and processing.
- Use a hashtable,
PSCustomObject
, or JSON string inside the-DefaultPolicy
(for the policy set create operation) or-Body
(for the policy create and update operations) parameter to set up your policy settings along with transformations, building out the data block with the transformation arguments.
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
transformations
argument. - Use the
postBreakpointTransformations
argument to list the effects to apply to the image area outside the break point.
Use variables
Many Image and Video Manager arguments let you specify a variable object instead of a string, number, or boolean value.
When using variables, define the variable name in the var
argument. For example, if you want a variable for the gravity
argument in a transformation, you would use the var
argument inside it. Then, provide the variable name as a value to reference your variable defined in the variables
block. This is intead of providing a direct value for the gravity
argument.
{
"transformations": [
{
"gravity": {
"var": "centerGravity"
},
"gravityPriority": "horizontal",
"image": {
"fill": "#000000",
"size": 72,
"stroke": "#FFFFFF",
"strokeSize": 0,
"text": "test",
"type": "Text"
},
"preserveMinorDimension": true,
"transformation": "Append"
},
{
"default": {
"aspect": "fit",
"height": {
"var": "ResizeDim"
},
"transformation": "Resize",
"type": "normal",
"width": {
"var": "ResizeDim"
}
},
"dimension": "height",
"lessThan": {
"allowExpansion": true,
"gravity": "Center",
"height": {
"var": "ResizeDim"
},
"transformation": "Crop",
"width": {
"var": "ResizeDim"
},
"xPosition": 0,
"yPosition": 0
},
"transformation": "IfDimension",
"value": {
"var": "MinDim"
}
}
],
"variables": [
{
"defaultValue": "280",
"name": "ResizeDim",
"type": "number"
},
{
"defaultValue": "10",
"name": "MinDim",
"type": "number"
},
{
"defaultValue": "Center",
"name": "centerGravity",
"type": "gravity"
}
]
}
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. |
IfDimension |
Chooses a transformation depending on the dimensions of the source image. Contains:
|
IfOrientation |
Chooses a transformation depending on the orientation of the source image. Contains:
|
ImQuery |
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:
|
{
"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": {
"type": "URL",
"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": "test"
},
"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
transformation with additional 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 image relative to the source image. The default centers the image. Value is one of:
var inside it instead of a direct value.
|
|
gravityPriority |
Determines the exact placement of the image when gravity is Center or a diagonal direction. Value is one of:
var inside it instead of a direct value.
|
|
preserveMinorDimension |
Whether to preserve the source image's minor dimension. The default is false .
var inside it instead of a direct value.
|
{
"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 AspectCrop
transformation with additional 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 |
---|---|
allowExpansion | Increases the size of the image canvas to achieve the requested aspect ratio instead of cropping the image. If setting a variable for this argument, use var inside it instead of a direct value. |
height | The height of the aspect ratio to crop. If setting a variable for this argument, use var inside it instead of a direct value. |
width | The width of the aspect ratio to crop. If setting a variable for this argument, use var inside it instead of a direct value. |
xPosition | The horizontal portion of the image you want to keep when applying aspect ratio cropping. If using allowExpansion , this setting defines the horizontal position of the image on the new expanded image canvas. If setting a variable for this argument, use xvar inside it instead of a direct value. |
yPosition | The horizontal portion of the image you want to keep when applying aspect ratio cropping. If using allowExpansion , this setting defines the horizontal position of the image on the new expanded image canvas. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "AspectCrop",
"allowExpansion": false,
"height": 9,
"width": 8,
"xPosition": 0.5,
"yPosition": 0.5
}
]
}
Crop
Use the Crop
transformation with additional arguments to reduce the area of an image.
All arguments are optional.
Argument | Description |
---|---|
allowExpansion | If cropping an area outside of the existing canvas, expands the image canvas. If setting a variable for this argument, use var inside it instead of a direct value. |
gravity | The placement of the crop relative to the source image. The available values include eight cardinal directions (North , South , East , West , NorthEast , NorthWest , SouthEast , SouthWest ) and Center by default. If setting a variable for this argument, use var inside it instead of a direct value. |
height | The number of pixels to crop along the y-axis. If setting a variable for this argument, use var inside it instead of a direct value. |
width | The number of pixels to crop along the x-axis. If setting a variable for this argument, use var inside it instead of a direct value. |
xPosition | The x-axis position to crop from. If setting a variable for this argument, use var inside it instead of a direct value. |
yPosition | The y-axis position to crop from. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "Crop",
"allowExpansion": false,
"gravity": "Center",
"height": 9,
"width": 8,
"xPosition": 0,
"yPosition": 0
}
]
}
Face crop
Use the FaceCrop
transformation with additional 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:
var inside it instead of a direct value. |
confidence | With algorithm set to dnn , the minimum confidence needed to detect faces in the image. Values range from 0 to 1 for increased confidence, and possibly fewer faces detected. If setting a variable for this argument, use var inside it instead of a direct value. |
failGravity | 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 ) and Center by default. If setting a variable for this argument, use var inside it instead of a direct value. |
focus | The focus of the crop rectangle, which is either around biggestFace or allFaces . This is all by default. If setting a variable for this argument, use var inside it instead of a direct value. |
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 ) and Center by default. If setting a variable for this argument, use var inside it instead of a direct value. |
height | The height of the output image in pixels relative to the specified style value. If setting a variable for this argument, use var inside it instead of a direct value. |
padding | The padding ratio based on the dimensions of the biggest face detected, This is 0.5 by default. Larger values increase padding. If setting a variable for this argument, use var inside it instead of a direct value. |
style | To crop or scale a crop area for the faces detected in the source image. This is zoom by default. The output image is resized to the specified width and height values. Value is one of:
var inside it instead of a direct value. |
width | The width of the output image in pixels relative to the specified style value. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"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 FeatureCrop
transformation with additional 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 |
---|---|
failGravity | 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 ) and Center by default. If setting a variable for this argument, use var inside it instead of a direct value. |
featureRadius | 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.0 by default. If setting a variable for this argument, use var inside it instead of a direct value. |
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 ) and Center by default. If setting a variable for this argument, use var inside it instead of a direct value. |
height | The height in pixels of the output image relative to the specified style value. If setting a variable for this argument, use var inside it instead of a direct value. |
maxFeatures | The maximum number of features to identify as important features. This maximum number of features is 32 by default. The strongest features are always chosen. If setting a variable for this argument, use var inside it instead of a direct value. |
minFeatureQuality | 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) to 1 (highest). This is 0.1 by default. If setting a variable for this argument, use var inside it instead of a direct value. |
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. If setting a variable for this argument, use var inside it instead of a direct value. |
style | Specifies how to crop or scale a crop area for the features identified in the source image. This is fill by default. The output image resizes to the specified width and height values. Value is one of:
var inside it instead of a direct value. |
width | The width in pixels of the output image relative to the specified style value. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"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 FitAndFill
transformation with additional 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 fillTransformation
argument to customize the transformation.
All arguments are optional.
Argument | Description |
---|---|
fillTransformation | Used to customize the sigma value for the fill image. |
height | The height value of the resized image. If setting a variable for this argument, use var inside it instead of a direct value. |
width | The width value of the resized image. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "FitAndFill",
"fillTransformation": {
"newKey": "New Value"
},
"height": 8,
"width": 7
}
]
}
Mirror
Use the Mirror
transformation with additional arguments to flip an image horizontally, vertically, or both.
All arguments are optional.
Argument | Description |
---|---|
horizontal | Flips the image horizontally. If setting a variable for this argument, use var inside it instead of a direct value. |
vertical | Flips the image vertically. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "Mirror",
"horizontal": false,
"vertical": true
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "Mirror",
"horizontal": false,
"vertical": true
}
]
}
Region of interest crop
Use the RegionOfInterestCrop
transformation with additional 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 |
---|---|---|
regionOfInterest |
✔ | 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 ) and Center by default. If setting a variable for this argument, use var inside it instead of a direct value. |
|
height |
The height in pixels of the output image relative to the specified style value. If setting a variable for this argument, use var inside it instead of a direct value. |
|
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 width and height values. Value is one of:
var inside it instead of a direct value.
|
|
width |
The width in pixels of the output image relative to the specified style value. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"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": [
{
"newKey": "New Value"
}
]
},
"gravity": "Center",
"height": 9,
"style": "fill",
"width": 7
}
]
}
Relative crop
Use the RelativeCrop
transformation with additional 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. If setting a variable for this argument, use var inside it instead of a direct value. |
north | The number of pixels to shrink or expand the top side of the image. If setting a variable for this argument, use var inside it instead of a direct value. |
south | The number of pixels to shrink or expand the bottom side of the image. If setting a variable for this argument, use var inside it instead of a direct value. |
west | The number of pixels to shrink or expand the left side of the image. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "RelativeCrop",
"east": 1,
"north": 0,
"south": 0,
"west": 1
}
]
}
Resize
Use the Resize
transformation with additional 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:
var inside it instead of a direct value. |
height | The height to which to resize the source image. Must be set if width is not specified. If setting a variable for this argument, use var inside it instead of a direct value. |
type | The type of constraints on the image resize. Value is one of:
var inside it instead of a direct value. |
width | The width to resize the source image to. Must be set if height is not specified. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "Resize",
"aspect": "fit",
"height": 9,
"type": "normal",
"width": 8
}
]
}
Rotate
Use the Rotate
transformation with the degrees
argument 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 var
inside it instead of a direct value.
{
"transformations": [
{
"transformation": "Rotate",
"degrees": 2.5
}
]
}
Scale
Use the Scale
transformation with additional 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.
var inside it instead of a direct value. |
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.
var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "Scale",
"height": 9,
"width": 8
}
]
}
Shear
Use the Shear
transformation with additional 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
BackgroundColor
transformation for these areas.
All arguments are optional.
Argument | Description |
---|---|
xShear | The amount to shear along the x-axis, measured in multiples of the image's width. Must be set if yShear isn't specified. If setting a variable for this argument, use var inside it instead of a direct value. |
yShear | The amount to shear along the y-axis, measured in multiples of the image's height. Must be set if xShear isn't specified. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "Shear",
"xShear": 2,
"yShear": 4
}
]
}
Smart crop
Use the SmartCrop
transformation with additional 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 FaceCrop
and FeatureCrop
transformations to automatically detect faces and pronounced features in an image.
- When
SmartCrop
finds 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 .
|
height | The height in pixels for an image relative to the style value. |
sloppy | Whether to sacrifice any image fidelity for transformation performance. If setting a variable for this argument, use var inside it instead of a direct value. |
style | Specifies how to crop or scale a crop area for an area of interest in the source image. Value is one of:
|
width | The width in pixels for an image relative to the style value. |
{
"transformations": [
{
"transformation": "SmartCrop",
"debug": false,
"height": 9,
"sloppy": false,
"style": "fill",
"width": 8
}
]
}
Trim
Use the Trim
transformation with additional 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 0 and 1 . This determines the acceptable amount of background variation before trimming stops. If setting a variable for this argument, use var inside it instead of a direct value. |
padding | The amount of padding in pixels to add to the trimmed image. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"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 BackgroundColor
transformation with the color
argument to set the hexadecimal CSS color value for the background.
If setting a variable for this argument, use var
inside it instead of a direct value.
{
"transformations": [
{
"transformation": "BackgroundColor",
"color": "#FFFFFF"
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "BackgroundColor",
"color": "#FFFFFF"
}
]
}
Blur
Use the Blur
transformation with the sigma
argument to apply a Gaussian blur to a given value.
- The value of
sigma
scatters 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 var
inside it instead of a direct value.
{
"transformations": [
{
"transformation": "Blur",
"sigma": 5
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "Blur",
"sigma": 5
}
]
}
Chroma key
Use the ChromaKey
transformation with additional 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 |
---|---|
hueFeather | How much additional hue to make semi-transparent beyond the hue_tolerance . The default is 0.083 which applies semi-transparency to hues 30 degrees around the Hue Tolerance. If setting a variable for this argument, use var inside it instead of a direct value. |
hueTolerance | 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.0 the entire image is made transparent. The default is approximately 0.083 or 8.3% of the color wheel. This value corresponds to 30 degrees around the specified hue. If setting a variable for this argument, use var inside it instead of a direct value. |
hue | The hue to remove. Enter the degrees of rotation (between 0 and 360) around the color wheel. By default ChromaKey removes a green hue which is at 120 degrees on the color wheel. If setting a variable for this argument, use var inside it instead of a direct value. |
lightnessFeather | How much additional lightness to make semi-transparent beyond the lightnessTolerance . The default value of 0.1 corresponds to 10% away from the tolerated lightness towards full black or full white. If setting a variable for this argument, use var inside it instead of a direct value. |
lightnessTolerance | 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.5 lightness 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 of 0.75 means that a color must be within 75% of the full color to full white or full black for full removal. If setting a variable for this argument, use var inside it instead of a direct value. |
saturationFeather | How much additional saturation to make semi-transparent beyond the saturation tolerance. The default is 0.1 which applies semi-transparency to hues 10% below the saturation_tolerance . If setting a variable for this argument, use var inside it instead of a direct value. |
saturationTolerance | 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.75 means that a color must be within 75% of full saturation to be made fully transparent. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "ChromaKey",
"hue": 120,
"hueFeather": 0.083,
"hueTolerance": 0.083,
"lightnessFeather": 0.1,
"lightnessTolerance": 0.75,
"saturationFeather": 0.1,
"saturationTolerance": 0.75
}
]
}
{
"postBreakpointTransformations": [
{
"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
transformation with additional 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 ) and Center by default. If setting a variable for this argument, use var inside it instead of a direct value. |
|
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. If setting a variable for this argument, use var inside it instead of a direct value. |
|
scale |
A multiplier to resize the applied image relative to the source image while preserving the aspect ratio (1 by default). Set the scaleDimension to calculate the scale from the source image's width or height. If setting a variable for this argument, use var inside it instead of a direct value. |
|
scaleDimension |
The dimension, either width or height , of the source image to scale. If setting a variable for this argument, use var inside it instead of a direct value. |
|
xPosition |
The x-axis position of the image to apply. If setting a variable for this argument, use var inside it instead of a direct value. |
|
yPosition |
The y-axis position of the image to apply. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"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": {
"type": "URL",
"url": "www.example.com/image.jpg"
},
"gravity": "Center",
"placement": "Over",
"scale": 1,
"scaleDimension": "width",
"xPosition": 1,
"yPosition": 0
}
]
}
Contrast
Use the Contrast
transformation with additional 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.0 to 1.0 . Values outside of the acceptable range clamp to this range. Positive values increase brightness and negative values decrease brightness.
var inside it instead of a direct value. |
contrast | The contrast of the image. Expressed as a range from -1 to 1 . Values outside of the -1 to 1 range clamp to this range.
var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "Contrast",
"brightness": 0.5,
"contrast": -0.3
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "Contrast",
"brightness": 0.5,
"contrast": -0.3
}
]
}
Goop
Use the Goop
transformation with additional 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.
var inside it instead of a direct value. |
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. If setting a variable for this argument, use var inside it instead of a direct value. |
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 . If setting a variable for this argument, use var inside it instead of a direct value. |
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, goop distorts 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. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "Goop",
"chaos": 0.25,
"density": 4,
"power": 2,
"seed": 3
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "Goop",
"chaos": 0.25,
"density": 4,
"power": 2,
"seed": 3
}
]
}
Grayscale
Use the Grayscale
transformation with the type
argument 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 var
inside it instead of a direct value.
{
"transformations": [
{
"transformation": "Grayscale",
"type": "Brightness"
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "Grayscale",
"type": "Brightness"
}
]
}
HSL
Use the HSL
(Hue/Saturation/Lightness) transformation with additional arguments to adjust the hue, saturation, and lightness (HSL) of an image.
Notes:
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 . If setting a variable for this argument, use var inside it instead of a direct value. |
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.
var inside it instead of a direct value. |
saturation | A multiplier to adjust the saturation of colors in the image.
var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "HSL",
"hue": 0.1,
"lightness": 1.8,
"saturation": 1.4
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "HSL",
"hue": 0.1,
"lightness": 1.8,
"saturation": 1.4
}
]
}
HSV
Use the HSV
(Hue/Saturation/Value) transformation with additional arguments to adjust an image's hue, saturation, and value (HSV).
Notes:
All arguments are optional.
Argument | Description |
---|---|
hue | The number of degrees to rotate colors around the color wheel. This is 0.0 by default. If setting a variable for this argument, use var inside it instead of a direct value. |
saturation | A multiplier to adjust the saturation of colors in the image.
var inside it instead of a direct value. |
value | A multiplier to adjust the lightness or darkness of the image's base color.
var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "HSV",
"hue": 0.2,
"saturation": 1.5,
"value": 0.8
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "HSV",
"hue": 0.2,
"saturation": 1.5,
"value": 0.8
}
]
}
Max colors
Use the MaxColors
transformation with the colors
argument 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 var
inside it instead of a direct value.
{
"transformations": [
{
"transformation": "MaxColors",
"colors": 5
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "MaxColors",
"colors": 5
}
]
}
Mono hue
Use the MonoHue
transformation with the hue
argument to set all hues in an image to a single hue represented by its number on the color wheel, 0
-360
.
MonoHue
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 var
inside it instead of a direct value.
{
"transformations": [
{
"transformation": "MonoHue",
"hue": 50
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "MonoHue",
"hue": 50
}
]
}
Opacity
The Opacity
transformation 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
1
decrease opacity. - A value of
0
makes an image completely transparent.
If setting a variable for this argument, use var
inside it instead of a direct value.
{
"transformations": [
{
"transformation": "Opacity",
"opacity": 0.8
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "Opacity",
"opacity": 0.8
}
]
}
Remove color
Use the RemoveColor
transformation with additional 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. If setting a variable for this argument, use var inside it instead of a direct value. |
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. If setting a variable for this argument, use var inside it instead of a direct value. |
tolerance | How close the color needs to be to the selected color before it's changed to fully transparent. Set to 0.0 to remove only the exact color specified. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "RemoveColor",
"color": "#FFFFFF",
"feather": 0.2,
"tolerance": 0.2
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "RemoveColor",
"color": "#FFFFFF",
"feather": 0.2,
"tolerance": 0.2
}
]
}
Unsharp mask
Use the UnsharpMask
transformation with additional 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. If setting a variable for this argument, use var inside it instead of a direct value. |
sigma | The standard deviation of the Gaussian distribution used in the unsharp mask, measured in pixels. This is 1.0 by default. High values emphasize large details and low values emphasize small details. If setting a variable for this argument, use var inside it instead of a direct value. |
threshold | The minimum change required to include a detail in the filter. Higher values discard more changes. If setting a variable for this argument, use var inside it instead of a direct value. |
{
"transformations": [
{
"transformation": "UnsharpMask",
"gain": 1,
"sigma": 1,
"threshold": 0.05
}
]
}
{
"postBreakpointTransformations": [
{
"transformation": "UnsharpMask",
"gain": 1,
"sigma": 1,
"threshold": 0.05
}
]
}
Updated about 15 hours ago