xtract.bot
POST /api/image-sharpen

Sharpen an image with the unsharp-mask technique. Configurable radius and amount. Useful for resampled images that look soft, or photos straight out of camera.

Applies an unsharp-mask sharpen — extracts a blurred copy of the image, subtracts it from the original to find edges, then adds those edges back at increased contrast. Inputs: - `radius` (default 1.5): how thick the sharpened edges are. - `amount` (default 0.5): how strongly to sharpen. Useful for downsampled images that look soft, photos straight out of camera, and any pre-processing where you want crisper edges.

Inputs

NameTypeDefaultDescription
image*fileInput image.
radiusnumber (0…50)0Kernel radius hint (0 = automatic).
sigmanumber (0.1…50)1Gaussian standard deviation.
formatenum (png | jpeg | webp)Output format.

Response

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

Code samples

Built from the default 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-sharpen \
  -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 '{
  "radius": 0,
  "sigma": 1,
  "image": "'"$IMAGE"'"
}'