xtract.bot
POST /api/image-padding

Add padding around an image: configurable per-side widths and a fill colour. Useful for matting, adding margins for OG images, or composing thumbnails.

Surrounds the image with extra pixels of a chosen fill colour. Per-side widths (`top`, `right`, `bottom`, `left`) or a uniform `padding` value. Use cases: matting photographs, adding margins for OG-image composition, padding to a target aspect ratio.

Inputs

NameTypeDefaultDescription
image*fileInput image (PNG / JPEG / WebP).
topnumber (0…8192)0Pixel padding on the top edge.
rightnumber (0…8192)0Pixel padding on the right edge.
bottomnumber (0…8192)0Pixel padding on the bottom edge.
leftnumber (0…8192)0Pixel padding on the left edge.
colorstring"transparent"Fill colour for the new pixels (any CSS / ImageMagick colour name). Default `transparent`.
formatenum (png | jpeg | webp)Output format. Defaults to the input's format.

Response

Modes: binary, base64-json. Cache: yes (24h TTL).