Subject Outline

Overview

The Image Editing API allows you to easily add a colored outline around the subject of your images.

outline.color

To add a colored outline to the subject of an image, set the outline.color argument to a solid color value. This can be any hexadecimal color code without the # symbol (examples: FF0000, FF0000EE) or a supported color name (see list below).

(original image)

outline.color=white

chevron-rightList of supported color nameshashtag
  • aqua

  • black

  • blue

  • cyan

  • fuchsia

  • gray

  • green

  • lime

  • magenta

  • maroon

  • navy

  • olive

  • purple

  • red

  • silver

  • teal

  • white

  • yellow

circle-exclamation

If you want to give it a try, here is a code snippet to reproduce the example above:

curl --request POST \
 --url 'https://image-api.photoroom.com/v2/edit' \
 --header 'Content-Type: multipart/form-data' \
 --header 'x-api-key: YOUR_API_KEY_HERE' \
 --form 'imageFile=@"/path/to/image.png"' \
 --form 'outline.color="white"' \
 --form 'referenceBox="originalImage"' \
 --form 'removeBackground="false"' \
 --output 'edited-image.png'

Additional Parameters

outline.width

To control the width (thickness) of the outline, set the argument outline.width to a value between 0 and 0.1.

The value represents a ratio of the image size, where 0.1 (10%) is the maximum thickness.

When this argument is not provided, the API applies a default value of 0.03.

Suggested values:

  • 0.01-0.02: Subtle/thin outline

  • 0.03-0.05: Standard/medium outline

  • 0.06-0.1: Bold/thick outline

outline.width=0.01

outline.width=0.03

outline.width=0.1

outline.blurRadius

You can apply blur to the outline to create a glow or soft edge effect.

To control the blur strength of the outline, set the outline.blurRadius argument to a value between 0 (no blur) and 0.025 (maximum blur).

When this argument is not provided, the API applies a default value of 0.

outline.blurRadius=0

outline.blurRadius=0.01

outline.blurRadius=0.025

Examples

(original image)

(edited image)

outline.color=white & outline.width=0.03 & removeBackground=false

outline.color=white & outline.width=0.02 & outline.blurRadius=0.02 & removeBackground=false

outline.color=black & outline.width=0.02 & removeBackground=true

outline.color=fcfc03 & outline.width=0.1 & outline.blurRadius=0.01 & removeBackground=false

Last updated

Was this helpful?