Skip to content

Border & Frame

Add borders, padding, rounded corners, and drop shadows to images. The tool applies effects in order: padding, border, corner radius, then shadow.

API Endpoint

POST /api/v1/tools/border

Parameters

ParameterTypeRequiredDefaultDescription
borderWidthnumberNo10Border thickness in pixels (0 to 2000)
borderColorstringNo"#000000"Border color as hex (e.g. #FF0000)
paddingnumberNo0Inner padding between image and border in pixels (0 to 200)
paddingColorstringNo"#FFFFFF"Padding fill color as hex
cornerRadiusnumberNo0Corner radius in pixels (0 to 2000)
shadowbooleanNofalseWhether to add a drop shadow
shadowBlurnumberNo15Shadow blur radius (1 to 200)
shadowOffsetXnumberNo0Shadow horizontal offset (-50 to 50)
shadowOffsetYnumberNo5Shadow vertical offset (-50 to 50)
shadowColorstringNo"#000000"Shadow color as hex
shadowOpacitynumberNo40Shadow opacity percentage (0 to 100)

Example Request

bash
curl -X POST http://localhost:13490/api/v1/tools/border \
  -F "[email protected]" \
  -F 'settings={"borderWidth":20,"borderColor":"#333333","cornerRadius":16,"shadow":true,"shadowBlur":25,"shadowOpacity":50}'

Example Response

json
{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/photo.png",
  "originalSize": 456789,
  "processedSize": 523456
}

Notes

  • Uses the standard createToolRoute factory. Accepts a single image file via multipart upload.
  • Supports HEIC, RAW, PSD, and SVG input formats (automatically decoded).
  • Processing order: padding is added first, then the border wraps around, then corner radius is applied, then the shadow is composited.
  • When cornerRadius or shadow is enabled, the output is forced to PNG (regardless of input format) to preserve transparency. Formats that support alpha (PNG, WebP, AVIF) keep their original format.
  • The shadow is shape-aware: it follows the rounded corners rather than creating a rectangular shadow.
  • Setting borderWidth to 0 and using only cornerRadius + shadow creates a frameless rounded shadow effect.