Guide

How to add a colored border to an image

Provide a nonempty base64-encoded image, choose a border width and a six-digit hexadecimal color, then submit it to receive bordered image data and dimension details when processing succeeds.

Tool Image Border

What Image Border does

Image Border adds a colored border or frame to supplied image data. It is useful when you want to give an image a visible edge, prepare a framed graphic, or apply the same border treatment with a chosen color and width. The tool accepts image data as a base64-encoded input string and returns the processed image as base64 text when processing succeeds.

How to add a border to an image

  1. Prepare the source image as a base64-encoded input string. The input field is optional in the declared contract, but leaving it empty causes processing to fail, so provide image data before processing.

  2. Choose the border width. If you do not provide a width, the default is 10. The selected width is passed to the image-border operation as provided.

  3. Set the border color. The default color is #000000, or black. For a custom color, use six hexadecimal characters, optionally preceded by #. Leading # characters are removed, and the six hexadecimal characters are interpreted as the red, green, and blue components.

  4. Submit the image data with the selected width and color. A successful result contains the bordered image as base64 text and includes both the original and resulting dimensions.

  5. Check the output format before saving or passing the result to another step. The processed image keeps its original format when one is available; otherwise, it is saved as PNG.

How to read the result

The returned base64 text represents the image after the border operation. Compare the original and resulting dimensions to understand how the selected border affected the image. A successful response includes both sets of dimensions, which helps you verify the output shape rather than relying only on the encoded text.

The output format depends on the source data: an available original format is retained, while an unavailable one results in PNG. The color setting controls the border or frame color, and the width setting controls the border width passed to the operation.

A successful result is not guaranteed for arbitrary input. Invalid or undecodable image data, invalid color values, missing dependencies, and other processing exceptions can produce an unsuccessful result. The runtime declares no network access, but that declaration does not establish a particular hosting environment or data-handling policy.

Worked example

A designer wants to add a blue frame to a prepared image while keeping the default border width.

Provide the prepared image data with width 10 and color #2f6fb0, then inspect the returned image text, dimensions, and format.

When processing succeeds, the result contains base64 text for the bordered image plus the original and resulting dimensions; the output keeps the source format when available or uses PNG otherwise.

Limitations

  • Processing can fail for empty, invalid, or undecodable image data, invalid color values, missing dependencies, or other processing exceptions. The declared lack of network access does not establish a hosting environment or data-handling policy.

Common errors

  • An empty image input or malformed color value can prevent processing. Provide a nonempty base64-encoded image string and check that the color uses six valid hexadecimal characters, with an optional leading #.

FAQ

What does Image Border return?

Yes, when processing succeeds. The result includes the bordered image as base64 text and the original and resulting dimensions. An empty input or processing exception can instead produce an unsuccessful result.

What border width is used if I do not choose one?

The default width is 10. If you provide another width, it is passed to the image-border operation as provided.

How should I enter the border color?

The default is #000000. For a custom color, provide six hexadecimal characters, optionally with a leading #; leading # characters are removed before the red, green, and blue components are interpreted.

Tool

Image Border