Bulk Image Converter & Compressor
Pricing
from $8.00 / 1,000 image converteds
Bulk Image Converter & Compressor
Convert, compress and resize images in bulk from URLs or uploaded files. Output WebP, AVIF, JPEG, PNG, GIF, TIFF or BMP, with HEIC input supported. Get public links and before/after file sizes for every image.
Pricing
from $8.00 / 1,000 image converteds
Rating
0.0
(0)
Developer
bite-sized-insights
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
15 hours ago
Last modified
Categories
Security
Limited permissionsShare
Bulk Image Converter & Compressor - JPEG, PNG, WebP, AVIF
Convert and compress images in bulk. Give it a list of image URLs (or files you uploaded to a key-value store), pick an output format and a quality, and get back smaller files with public links and a before/after size report for every image.
What this actor does
- Converts between formats. Read JPEG, PNG, WebP, AVIF, GIF, TIFF, BMP and HEIC/HEIF (iPhone photos); write JPEG, PNG, WebP, AVIF, GIF, TIFF or BMP. Or keep each image's own format and only compress it.
- Compresses with a quality setting from 1 to 100. Pick WebP or AVIF for the smallest files, JPEG for maximum compatibility. For PNG, a lower quality reduces the number of colors.
- Resizes to a maximum width and/or height. Images are scaled down to fit inside the box without distortion, and are never enlarged. Switch off Keep aspect ratio to apply each limit to its own side.
- Strips metadata. Removes camera details and GPS location, converts colors to standard sRGB and rotates photos upright, so files get smaller and safer to publish. Turn it off to keep the metadata.
- Handles transparency. Transparent PNG/WebP/AVIF images stay transparent; for formats without transparency (JPEG, BMP) the transparent areas are filled with a background color you choose.
- Keeps animations. Animated GIF and WebP files stay animated when converted to GIF or WebP.
- Converts uploaded files too. Upload files to a key-value store and list their keys next to (or instead of) the URLs.
- Reports the savings. Every row shows the original and new size in bytes, the bytes and percentage saved, and the image dimensions before and after.
- Delivers public links. Converted files are saved to the run's key-value store; each dataset row links straight to its file.
- Runs images concurrently and adds each result to the dataset as soon as it is ready.
Quick start
{"urls": ["https://www.python.org/static/img/python-logo.png","https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"],"outputFormat": "webp","quality": 80,"maxWidth": 1600}
Click Start. Converted files appear in the key-value store and the dataset as each image finishes.
Input parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
urls | Array[String] | No* | Public image URLs to convert (up to 25 MB each). |
uploadKeys | Array[String] | No* | Keys of image files you uploaded to a key-value store. |
uploadStoreName | String | No | Key-value store holding the uploaded files. Empty = the default store. |
outputFormat | String | No | webp (default), jpeg, png, avif, original, gif, tiff or bmp. |
quality | Integer | No | 1-100, default 80. |
maxWidth | Integer | No | Maximum width in pixels, 0 = no limit (default). |
maxHeight | Integer | No | Maximum height in pixels, 0 = no limit (default). |
keepAspectRatio | Boolean | No | Fit inside the maximum box without distortion. On by default. |
stripMetadata | Boolean | No | Remove metadata and convert colors to sRGB. On by default. |
backgroundColor | String | No | Hex color for filling transparency when the output has none. Default #ffffff. |
* At least one image is required, from urls and/or uploadKeys. Up to 1000 images per run in total. Only public
http(s) URLs are accepted; entries pointing at private or local addresses, containing credentials, or otherwise
malformed are rejected as invalid input before any request is made. Duplicate entries are processed once.
Converting your own files
- Create or open a key-value store in Apify Console and upload your images, or put them into the run's default key-value store through the API.
- Enter the record keys (for example
holiday-01.heic) under Uploaded file keys. If the files live in a named store, enter its name under Key-value store name for uploaded files.
Output
One dataset row per input image, in the order of the input (URLs first, then uploaded files). The converted file
itself is stored in the run's key-value store under the key <index>-<name>.<extension>, and outputUrl is its
public link.
Successful conversion
{"index": 1,"source": "https://www.python.org/static/img/python-logo.png","sourceType": "url","status": "success","outputUrl": "https://api.apify.com/v2/key-value-stores/xxxxxxxxxxxxxxxxx/records/00001-python-logo.webp","outputKey": "00001-python-logo.webp","sourceFormat": "png","outputFormat": "webp","sourceBytes": 15770,"outputBytes": 6178,"bytesSaved": 9592,"savedPercent": 60.8,"sourceWidth": 601,"sourceHeight": 203,"outputWidth": 601,"outputHeight": 203,"error": null}
Failed image
{"index": 2,"source": "https://example.com/not-an-image.html","sourceType": "url","status": "failed","outputUrl": null,"outputKey": null,"sourceFormat": null,"outputFormat": null,"sourceBytes": null,"outputBytes": null,"bytesSaved": null,"savedPercent": null,"sourceWidth": null,"sourceHeight": null,"outputWidth": null,"outputHeight": null,"error": "The file is not a supported or readable image."}
bytesSaved and savedPercent are negative when the converted file is larger than the original, which can happen
when converting an already well-compressed image to a different format. Choose a lower quality or another format in
that case.
An image fails (and is not charged) when it cannot be downloaded, is not a readable image, is larger than 25 MB, has
too many pixels to process safely, or its URL points to a private or internal address. The error field says which. A
problem with the conversion service's credentials does not produce a row; it fails the whole run with an error
message.
Pricing: pay per converted image
Only successfully converted images are billed. Failed images are free. A tiny flat per-run start fee also applies, and Apify's platform dataset-item fee ($0.00001 per row) applies to every row written to the dataset, including failed rows.
| Event | Price |
|---|---|
| Image converted | $0.008 per image ($8.00 per 1,000 images) |
| Run start | $0.00005 per run |
FAQ
Which formats can I convert to? JPEG, PNG, WebP, AVIF, GIF, TIFF and BMP. HEIC/HEIF files can be read but not written.
Is there a size limit? Each source file may be up to 25 MB and up to 50 megapixels. Larger images are reported as failed rows.
Are my uploaded files public? The converted files are stored in the run's key-value store and are reachable through the links in the dataset. Your source files stay where you uploaded them.
Why is a converted file sometimes bigger? Re-encoding an image that is already heavily compressed can increase its size. Lower the quality, choose WebP or AVIF, or reduce the maximum width.