Skip to main content

Image actions

Image actions let you prepare, analyze, and enhance images within Workforce flows. The descriptions here outline the purpose, when to use, and the most commonly used inputs and outputs for each action.

Tip

Additional input and output variables may be available when designing flows.

Load Image from URL
Link copied!

Loads an image from an external web location, by passing an image URL to the input. The output image can then be used in any of the other image actions.

Inputs: Image URL (string)

Outputs: Image

Featured in these example flows

Adjust Image Size
Link copied!

Gives the option to change the canvas size, positioning and padding of an image.

Tip

This action is useful to use after Trim Image, to resize an image with a transparent background.

Inputs:

InputTypeRequiredDescription
imageImageYesThe image to crop
widthnumberYesThe target width of the output image in pixels. Default: 2000
heightnumberYesThe target height of the output image in pixels. Default: 2000
positionstringNoThe position of the image subject within the resized canvas. For example, Top left, Middle right
paddingstringNoPadding to apply inside the canvas. Accepts 1–4 comma-separated values (pixels or percentages). Negative values are allowed. See Padding syntax below

Padding syntax: Like CSS shorthand: comma-separated pixels or percentages, negative values are allowed:

Example valuesApplies to
10All sides
10,20Top/bottom, left/right
10,20,30Top, left/right, bottom
10%,-5%,10%,5%Top, right, bottom, left (clockwise)

Outputs:

OutputTypeDescription
imageImageThe size adjusted image

Example

Here's an example result from the Adjust Image Size action, with width and height set to 3000px, and 10% padding on all sides:

Workforce Flows run window showing output for the Adjust Image Size action

Trim Image
Link copied!

Automatically trims an image down to its non-transparent foreground, removing any surrounding empty space based on the alpha channel. No padding is added.

Tips

Inputs: Image (The image to trim - requires a transparent background)

Outputs: Image (Trimmed image)

Example

Here's an example result from the Trim Image action:

Workforce Flows run window showing the output for the Trim Image action

Fill Background
Link copied!

Replaces any transparent background with a color of your choice.

Tip

If your image doesn’t have a transparent background, try using the Remove Background action first.

Inputs: Image (with background removed), the Background Color - can be rgba or hex format

Outputs: Image (with background fill applied)

Example

Here's an example result from the Fill Image Background action:

Workforce Flows run window showing the output for the Fill Image Background action

Crop Image
Link copied!

Automatically crops an image by determining the primary foreground object, positioning the object within the new canvas size you specify and applying the specified padding.

Note

Cropping an image isn't always suitable for images that lack a clear separation between foreground and background (for example, lifestyle shots). For these images, Adjust Image Size on its own may be more suitable.

The Allow Upscaling option is useful if the original foreground object is smaller than the requested output size. It allows the action to scale the image up, rather than stopping with an error. Note that scaling up may slightly reduce image quality.

Inputs:

InputTypeRequiredDescription
imageImageYesThe image to crop
widthnumberYesThe target width of the output image in pixels. Default: 2000
heightnumberYesThe target height of the output image in pixels. Default: 2000
paddingstringNoPadding to apply inside the canvas. Accepts 1–4 comma-separated values (pixels or percentages). Negative values are allowed. See Padding syntax below
positionenumNoThe position of the image subject within the cropped canvas. For example, Top left, Middle right. See Position values below
allowUpscalingbooleanNoWhen enabled, the foreground image will be upscaled to fill the canvas if it is smaller than the target dimensions. Default: true

Padding syntax

Like CSS shorthand: comma-separated pixels or percentages, negative values are allowed.

Example valuesApplies to
10All sides
10,20Top/bottom, left/right
10,20,30Top, left/right, bottom
10%,-5%,10%,5%Top, right, bottom, left (clockwise)

Position values

The position input controls where the image subject is placed within the cropped canvas, and accepts one of the following.

ValuePosition
TLTop left
TCTop center
TRTop right
MLMiddle left
MCMiddle center
MRMiddle right
BLBottom left
BCBottom center
BRBottom right

Outputs:

OutputTypeDescription
imageImageThe cropped image

Example

Here's an example result from the Crop Image action, using the default width and height, 10% padding on all sides, and upscaling enabled:

Workforce Flows run window showing output for the Crop Image action

Featured in these example flows

Normalize Background
Link copied!

Changes the background color of the image, while maintaining shadows and highlights, to make background color more consistent or realistic.

Inputs:

  • Image - The original image

  • Foreground (image) - A version of the original image with the background removed (for example, by using Remove Background)

  • Background Color (string, required). This is the color that should be applied (in RGBA format)

Outputs: Image with normalized background

Example

Here's Normalize Background in use. A Form trigger allows the user to upload the original image, then the background is removed ready for normalization.

The Normalize Background action in use within a flow

Featured in these example flows

Remove Background
Link copied!

Uses AI to remove the background from images.

Inputs: Image

Outputs: Image with background removed

Example

Here's an example result from the Remove Background action:

Workforce Flows run window showing the output for the Remove background action

Modify Tags
Link copied!

Add or remove tags from an image.

Inputs

InputTypeRequiredDescription
imageImageYesThe image to add or remove tags from
addarray of stringsNoTags to add to the image
removearray of stringsNoTags to remove from the image
caseInsensitivebooleanNoWhen enabled, tag matching ignores case. Default: false

Outputs

OutputTypeDescription
imageImageThe image with the updated tags

Auto Detect Tags
Link copied!

Analyses images and automatically applies tags based on natural-language rules.

Configuration:

  • Model - Choose a model with with image analysis capabilities

  • Tags (array of tags and tag descriptions) - Add your custom tags together with a natural language description of what the LLM should look for when analyzing the image. If the LLM finds a match for the description, the tag name will be added to the tags array. Multiple tags can be added at a time.

    For each tag, you enter details for when the tag is to be applied. For example, for a tag of "Shoe", the When to apply this tag field could contain "When the image contains a shoe". Or you could be more specific and tag particular types of shoe.

    Workforce Flows designer window showing example of how to configure tags

Inputs Image (to analyze)

Outputs: Image (with the detected tags applied)

Featured in these example flows

Extract Swatch
Link copied!

Extracts a color swatch from an image using AI to identify the most representative color area of a product.

The swatch can be focused on a specific product or be taken from the center of the image.

Configuration:

  • Model - Use a model with image analysis capabilities.

Inputs:

  • Image - The image to extract the swatch from.
  • Size - The width and height of the swatch (in pixels). Minimum: 1, maximum: 512. Default: 64. Swatches are always square.
  • Product (optional) - The name or description of the product in the image to focus on when extracting the swatch. If not provided, the action is prompted to find the most obvious product within the image and to extract a swatch from that.

Outputs: Color swatch as a square image at the specified size

Also outputs variables for:

  • Bounds - Bounding box coordinates showing where the swatch was extracted from
  • Dominant colors - RGBA format (Example: rgba(255, 128, 64, 1.1)) and HEX format (Example: #FF8040)

Note, if the generated swatch is close to the edge of the image, a closest match is generated.

Example:

Here's Extract Swatch in use. The input form allows an image and product name to guide the swatch output.

Workforce run window showing Extract swatch in use with an image and a product name

Featured in these example flows

Tips for using image actions
Link copied!

Save image output
Link copied!

To save image action output directly from a flow run:

  1. In the flow run, hover over the image until the magnify icon displays: Workforce run window showing an image magnified for viewing
  2. Click to open the magnified view, then right-click the image and select "Save image as...": Workforce run window with the save image as menu option displayed
Note

The right-click menu and wording may vary slightly depending on your browser.

Trim Image versus Crop Image
Link copied!

Although these actions sound similar, they work differently and serve different purposes. Trim Image automatically removes empty space based on transparency, while Crop Image automatically locates the primary foreground object then positions the object within the new canvas size you specify and applies the specified padding. Trim Image is often used in combination with other actions to achieve a similar result to Crop Image.

Running Remove Background → Trim Image → Adjust Image Size produces similar framing to Crop Image alone, but with the background fully removed.

Adding actions to flows

Inputs, outputs and ports

Input field variables