usely.tools

Resize, crop, compress and convert with 1 API call

Integrate image editing into your app or workflow. POST an image with the dimensions, crop, format and file-size budget you want — get the optimized bytes straight back. Pure CPU processing, no queue, no cold starts.

Get API Key

Not a developer? Use the web app instead — no code required.

Easy to integrate

A simple HTTP interface with sensible options:

Source images
Direct upload (image_file), a URL (image_url), or a base64 string (image_base64). JPG, PNG, WebP, GIF, TIFF and AVIF in — up to 50 MB and 64 megapixels.
Result images
Binary image file by default, or JSON-encoded data (base64 + dimensions) with Accept: application/json.
Output resolution
Any size up to 8000×8000 px, full resolution, never watermarked.

Get started

Create an API key in your dashboard, then send your first request. Optimization calls are free by default; failed calls are never charged. Authenticate with X-Api-Key: rs_live_ (or Authorization: Bearer rs_live_).

Sample code

Resize to 1200px wide, convert to WebP and stay under 200 KB:

curl -H "X-Api-Key: rs_live_..." \
  -F "image_file=@/path/to/photo.jpg" \
  -F "width=1200" \
  -F "format=webp" \
  -F "target_kb=200" \
  -f https://usely.tools/api/v1/resize \
  -o photo-1200.webp

Cut an exact region with a smart crop:

# Smart-crop a 1080×1080 square around the most interesting region,
# then resize is skipped (crop output IS the result)
curl -H "X-Api-Key: rs_live_..." \
  -F "image_file=@banner.jpg" \
  -F "crop_width=1080" -F "crop_height=1080" \
  -F "gravity=attention" \
  -f https://usely.tools/api/v1/resize -o square.jpg

Output formats

Request one of the formats below via the format parameter, or omit it (keep) to stay in the input format.

FormatTransparencyPros & cons
jpegNo+ Smallest for photos · + Universal · − No transparency (flattened onto the pad color)
pngYes+ Lossless · + Transparency · − Larger files (quality/target_kb do not apply)
webpYes+ Small files with transparency · + Every modern browser · − Not for legacy tooling
avifYes+ Best compression per quality · − Slower to encode · − Limited legacy support
tiffNo+ Print/archival workflows · − Very large files
icoYes+ Favicons (auto-capped at 256px) · − Only useful as an icon

For photos on the web, webp with a target_kb budget is the sweet spot. Use png when you need pixel-perfect graphics or lossless transparency.

API Reference

POST /api/v1/resize

Resizes, crops, compresses and/or converts a JPG / PNG / WebP / GIF / TIFF / AVIF image. File size up to 50 MB; input up to 64 megapixels; output up to 8000 px per side. Requires an API key in the X-Api-Key header (or a Bearer token in Authorization). All parameters are optional — with none, the call is a pure re-encode.

Request body — multipart/form-data or application/json

ParameterTypeDescription
image_filebinarySource image file (multipart). Exactly one image source is required.
image_base64stringSource image as a base64-encoded string (JSON body).
image_urlstringSource image URL to fetch (JSON body).
widthintegerTarget width in px (≤8000). If only one dimension is given, the other is derived from the aspect ratio.
heightintegerTarget height in px (≤8000).
algorithmstringResampling kernel: nearest · bilinear · bicubic (default) · lanczos.
crop_modestringWhat happens when the target aspect differs: pad (default — fit inside, pad the rest), fill (cover + crop at gravity), stretch (distort).
pad_colorstringPadding / JPEG-flatten color: transparent (default) · white · black.
gravitystringCrop anchor for crop_mode=fill and the custom crop: center (default) · top · bottom · left · right · attention (auto-detects the most salient region).
crop_widthintegerCustom crop: cut an exact crop_width×crop_height region at gravity before any resize. Both must be given; the region is clamped to the image bounds. Positional gravities are pixel-exact (no resampling).
crop_heightintegerSee crop_width.
formatstringOutput format: keep (default) · jpeg · png · webp · avif · tiff · ico.
qualityinteger1–100 (default 90). Applies to lossy formats (JPEG/WebP/AVIF/TIFF).
target_kbintegerBest-effort maximum output size in KB. The server re-encodes at decreasing quality (up to 6 iterations) until the result fits. Lossy formats only; ignored for PNG/ICO. The floor is quality 1 — a tiny budget on a huge image may still come out over.
keep_metadatabooleantrue keeps EXIF/ICC/XMP metadata in the output. Default false — metadata is stripped (orientation is applied first either way).
vignettenumber0–100 radial darkening (default 0).
sharpennumber0–200 unsharp-mask strength (default 0).
grayscalebooleanConvert to grayscale (default false).
brightnessnumber−100…100 (default 0).
contrastnumber−100…100 (default 0).

Request headers

HeaderDescription
X-Api-KeyYour API key (rs_live_). Also accepted as Authorization: Bearer ….
Acceptapplication/json to receive base64 + dimensions instead of binary.
Idempotency-KeyOptional. Retries with the same key return the original response and are never double-charged.

Responses

CodeDescription
200Image optimized. Binary image (or JSON when Accept: application/json). Response headers include X-Bytes-In/X-Bytes-Out, X-Width/X-Height, credit and rate-limit headers.
400Invalid parameters or unprocessable input (no credits charged). Envelope: { "error": { "code", "message" } }.
401Authentication failed — missing or invalid API key.
402Insufficient credits (only possible when a non-zero cost is configured).
413Upload over 50 MB or input over 64 megapixels.
429Rate limit exceeded (no credits charged). Includes a Retry-After header.

Response headers

HeaderDescription
X-Width / X-HeightDimensions of the result image.
X-Bytes-In / X-Bytes-OutInput and output sizes — your compression receipt.
X-Credits-ChargedCredits charged for this call (0 by default).
X-Credits-RemainingRemaining wallet balance after the call.
X-RateLimit-RemainingRequests remaining in the current window.

Account endpoint

GET /api/v1/account

Fetch the current credit balance for the authenticated key. Balance changes may lag a few seconds; to track locally, read this once and then adjust using the X-Credits-Charged header returned by each call.

{
  "data": {
    "credits": { "balance": 200 }
  }
}