border

The border transformation adds a decorative border or frame around an image. Specify the width and color to create picture frames, photo gallery effects, or add visual separation. Perfect for creating themed image galleries or framing product photography.

Serving Content via CDN

The Media API is a CDN-based service that serves transformed images via GET requests. When you request a transformed image URL, the transformation is applied dynamically on the first request and then cached for subsequent requests.

URL Pattern

https://media.vyso.io/border:width=W:color=HEX/ASSET_ID.jpg

Examples

Simple Black Border (5px)

curl -i GET https://media.vyso.io/border:width=5:color=000000/ASSET_ID.jpg

Thick White Border (10px)

curl -i GET https://media.vyso.io/border:width=10:color=ffffff/ASSET_ID.jpg

Colored Border (Blue, 8px)

curl -i GET https://media.vyso.io/border:width=8:color=4a90e2/ASSET_ID.jpg

Frame Effect (20px Gold)

curl -i GET https://media.vyso.io/border:width=20:color=d4a574/ASSET_ID.jpg

Subtle Border (2px Gray)

curl -i GET https://media.vyso.io/border:width=2:color=cccccc/ASSET_ID.jpg

On the first request, you'll receive a X-Cache: MISS header while the transformation is applied and cached. Subsequent requests will return X-Cache: HIT.

Parameters

widthREQUIRED

Border width in pixels. Accepted values:

  • Range: 1 to 500+
  • 2-5 - Subtle border
  • 10-20 - Strong frame effect
colorREQUIRED

Border color. Accepted formats:

  • Hex color (without #): 000000 (black)
  • CSS color name: white
  • 6-digit hex format required for hex colors

Response

The API returns the image with a border frame added around all edges. The response format depends on the format of the asset stored in the Vyso asset cloud.

Content-Type: Determined by the stored asset format (e.g., image/jpeg, image/png)