Skip to content

Stitch / Combine

Join multiple images side by side, stacked vertically, or arranged in a grid. Supports alignment, gap, border, corner radius, and multiple resize modes.

API Endpoint

POST /api/v1/tools/stitch

Parameters

ParameterTypeRequiredDefaultDescription
directionstringNo"horizontal"Layout direction: horizontal, vertical, grid
gridColumnsintegerNo2Number of columns when direction is grid (2 to 100)
resizeModestringNo"fit"How images are resized: fit, original, stretch, crop
alignmentstringNo"center"Cross-axis alignment: start, center, end
gapnumberNo0Gap between images in pixels (0 to 1000)
bordernumberNo0Outer border width in pixels (0 to 500)
cornerRadiusnumberNo0Corner radius applied to final output (0 to 500)
backgroundColorstringNo"#FFFFFF"Background/border color as hex (e.g. #FF0000)
formatstringNo"png"Output format: png, jpeg, webp, avif, jxl
qualitynumberNo90Output quality (1 to 100)

Example Request

bash
curl -X POST http://localhost:13490/api/v1/tools/stitch \
  -F "[email protected]" \
  -F "[email protected]" \
  -F "[email protected]" \
  -F 'settings={"direction":"horizontal","resizeMode":"fit","gap":10,"backgroundColor":"#FFFFFF","format":"png"}'

Example Response

json
{
  "jobId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "downloadUrl": "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/stitch.png",
  "originalSize": 1234567,
  "processedSize": 987654
}

Notes

  • Requires at least 2 images. Upload multiple image files in the multipart request.
  • Supports HEIC, RAW, PSD, and SVG input formats (automatically decoded).
  • Resize modes:
    • fit - Scale images to match the smallest dimension along the joining axis.
    • original - Keep original sizes (may produce uneven edges).
    • stretch - Force images to match the smallest dimension without preserving aspect ratio.
    • crop - Cover-crop images to match the smallest dimension.
  • In grid mode, cells are sized to the median dimensions of all images.
  • The cornerRadius is applied to the entire final output, not individual images.
  • Canvas size is limited by the MAX_CANVAS_PIXELS server configuration to prevent memory exhaustion.