The Image Editing API allows you to easily add a colored outline around the subject of your images.
To add a colored outline to the subject of an image, set the outline.color argument to a solid color value.
It can be any hexadecimal color code without the # symbol (examples: FF0000, FF0000EE) or a supported color name (see list below).
List of supported color names
To preserve the background, you must also set removeBackground to false.
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 'x-api-key: YOUR_API_KEY_HERE' \
--form 'imageFile=@"/path/to/image.png"' \
--form 'outline.color="white"' \
--form 'referenceBox="originalImage"' \
--form 'removeBackground="false"' \
--output result.png
Additional Parameters
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.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.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