All guides

Workflow and API guide

From crop to batch: a practical Tinify workflow

Build a repeatable crop, resize, compression, and API batch workflow with two-hour result expiry.

A dependable image pipeline separates creative decisions from repeatable processing. Crop is usually a visual decision made one image at a time; resize and compression are good batch operations once those decisions are fixed.

1. Crop in pixels

Tinify's crop editor uses one pixel-based coordinate model internally. Choose the focal area, verify its output dimensions, and export the crop before generating other sizes. Crop handles one image at a time in v1 so every composition can be checked deliberately.

2. Resize and compress as a batch

The free web tools accept up to 50 files per batch for compression and resize. Each file can be up to 40 MB and 50 megapixels. A batch may finish partially: successful files remain downloadable while failed files keep an explicit error and can be retried individually.

Results show the source and output format, dimensions, byte values, duration, and whether size decreased or increased. Batch ZIP files are streamed by the backend rather than rebuilt from every image in browser memory.

3. Automate repeatable work with API v1

For a single image, use one of the synchronous endpoints:

POST /api/v1/images/compress
POST /api/v1/images/resize
POST /api/v1/images/crop

For larger jobs, create a signed upload session, upload the files, and commit the batch:

POST /api/v1/batches
POST /api/v1/batches/{id}/commit
GET  /api/v1/batches/{id}
DELETE /api/v1/batches/{id}

Send an Idempotency-Key when creating work. Keep the returned X-Request-Id in your logs, honor Retry-After, and treat each file's state as authoritative. The complete local contract is available on the Developers page.

4. Plan for expiry and cancellation

Inputs and results expire two hours after completion. Signed upload and download URLs are deliberately short-lived. Copy approved assets into storage you control, and do not use Tinify's result URL as a permanent production URL.

Canceling a batch is idempotent: repeating the request does not create a second side effect. Failed, canceled, and idempotent retries are not counted as successful billable operations.

A simple rule of thumb

  • Crop when the composition changes.
  • Resize when the rendered dimensions change.
  • Compress after dimensions and format are settled.
  • Use batch or API only when the same rules apply repeatedly.

That order keeps the visual choices human while making the mechanical work predictable.