v1
v1-convert

Compress Image

Compress a PNG, JPEG or WebP image without changing its format.

Lossless-first: metadata is stripped (ICC profile and EXIF orientation are preserved) and the image is re-encoded with the format's strongest lossless settings; the result is never larger than the input. When target_size_kb is given and lossless compression alone can't reach it, the image is downscaled with the aspect ratio locked until it fits (best effort — an unreachable target returns the smallest achievable file).

Args: file: PNG, JPEG or WebP image file (.png/.jpg/.jpeg/.webp) to compress target_size_kb: Optional size budget in KB. Omitted -> lossless-only. output_filename: Optional custom output filename. If not provided, uses input filename (extension is preserved). direct_download: If True (default), return file directly. Set to False for JSON metadata.

post/v1/convert/compress-image

Request

  • Base URL: https://api.enconvert.com (the document declares no server; this is the origin it was published from)
  • URL: https://api.enconvert.com/v1/convert/compress-image
  • Auth: none declared

Headers

X-API-Keystring nullable
authorizationstring nullable

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.