xtract.bot

Image flip / mirror

Try it interactively →
POST /api/image-flip

Mirror an image — horizontal flip (left/right), vertical flip (upside-down), or both. Lossless on lossy formats too: only the pixel order is changed.

Mirrors the image. Three modes: - `horizontal`: left-right mirror. - `vertical`: top-bottom mirror. - `both`: equivalent to a 180° rotation. Output keeps the input format. For lossy formats (JPEG / WebP), this is effectively lossless because only pixel order changes — no new compression decisions are made.

Inputs

NameTypeDefaultDescription
image*fileInput image (PNG / JPEG / WebP).
directionenum (horizontal | vertical | both)"horizontal"Which axis (or both) to mirror across.
formatenum (png | jpeg | webp)Output format. Defaults to the input's format.

Response

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

Code samples

Built from the horizontal-png example.

# Download or substitute the example input:
#   curl -O https://xtract.bot/examples/image-png-to-webp/sample.png
IMAGE=$(base64 -w0 < sample.png)

curl -X POST https://api.xtract.bot/api/image-flip \
  -H "Content-Type: application/json" \
  -H "Accept: application/octet-stream" \
  -H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
  -H "X-Api-Key: $XTRACT_API_KEY" \
  -d '{
  "direction": "horizontal",
  "image": "'"$IMAGE"'"
}'