OrbTop

Image Format Converter

DEVELOPER TOOLSOTHER

Independent tool. Trademarks referenced on this page are the property of their respective owners and are used only to identify the public website this tool reads. No affiliation or endorsement.

Image Format Converter

Convert images between PNG, JPEG, WEBP, and AVIF, with optional resize, aspect-ratio fit, and quality control. Point it at image URLs or inline data: URIs and get back one record per image with the converted file's download link and dimensions.


What this actor does

For each image in your input list, the actor:

  1. Fetches or decodes the source — a plain http(s) URL is downloaded; a data: URI (e.g. data:image/png;base64,...) is decoded inline, no network round-trip needed
  2. Optionally resizes it to the width/height you specify, using the fit mode you choose
  3. Re-encodes it to your target format at the quality level you choose
  4. Saves the converted file to the run's key-value store and returns a public download link

Every attempted image gets exactly one output record, whether the conversion succeeded or not — a bad URL or an unreadable file shows up as a record with status: "error" and a reason, not a crashed run.

Scope note: SVG is accepted as a source image (it's rasterized before conversion) but is not offered as a target format — turning a raster photo into a true vector SVG needs a tracing algorithm, not a format re-encode, and that isn't what this actor does.


Input

Field Type Default Description
images array of strings — Required. Image sources to convert, one result record per entry. Each is either a direct http(s) URL or an inline data: URI
targetFormat string (enum) webp Required. Output format for every converted file: jpeg, png, webp, or avif
quality integer 80 Encode quality 1-100 for lossy formats (jpeg, webp, avif). Ignored for png, which is always lossless
resizeWidth integer — Target width in pixels. Leave blank to keep the source width (or derive it from resizeHeight, preserving aspect ratio)
resizeHeight integer — Target height in pixels. Leave blank to keep the source height (or derive it from resizeWidth, preserving aspect ratio)
fit string (enum) inside How to fit the image when both resizeWidth and resizeHeight are set: inside, outside, cover, contain, or fill. Ignored when only one dimension (or neither) is set
smartCrop boolean false When fit is cover, crop toward the most visually significant region instead of the image center
maxItems integer 5 Maximum number of images to convert in this run (one record per image, in input order)

Example input:

{
  "images": [
    "https://example.com/photo.jpg",
    "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
  ],
  "targetFormat": "webp",
  "quality": 80,
  "resizeWidth": 800,
  "resizeHeight": 800,
  "fit": "inside"
}

Output

One record per input image, always — success and failure alike.

Field Type Description
sourceIndex integer Position of this image in your images array
source string The input URL (a data: URI is shown as the literal string "[data URI]")
status string ok or error
errorMsg string Why the conversion failed; null on success
originalFormat string Detected source image format (e.g. png, jpeg); null on failure
originalWidth integer Source image width in pixels; null on failure
originalHeight integer Source image height in pixels; null on failure
originalSizeBytes integer Source image size in bytes; null on failure
convertedFormat string Output format actually written (matches targetFormat); null on failure
convertedWidth integer Output image width in pixels after any resize; null on failure
convertedHeight integer Output image height in pixels after any resize; null on failure
convertedSizeBytes integer Output file size in bytes; null on failure
downloadUrl string Public URL to download the converted file from the run's key-value store; null on failure

Example output record:

{
  "sourceIndex": 0,
  "source": "https://example.com/photo.jpg",
  "status": "ok",
  "errorMsg": null,
  "originalFormat": "jpeg",
  "originalWidth": 2400,
  "originalHeight": 1600,
  "originalSizeBytes": 843210,
  "convertedFormat": "webp",
  "convertedWidth": 800,
  "convertedHeight": 533,
  "convertedSizeBytes": 61244,
  "downloadUrl": "https://api.apify.com/v2/key-value-stores/<store-id>/records/converted-0000.webp"
}

Limits

Each source image is capped at 15 MB before decoding — comfortably above any ordinary photo or screenshot. A handful of conversions run in parallel per batch, so very large runs process steadily rather than all at once.


Use cases

  • Web/app asset pipelines: Batch-convert uploaded photos to WEBP/AVIF for smaller page weight
  • Thumbnail generation: Resize and re-encode a product catalog's images to a consistent size
  • Format normalization: Standardize a mixed PNG/JPEG/WEBP image set to one target format before downstream processing
  • Inline asset conversion: Convert a base64-embedded image straight from another tool's output without hosting it first