Image Converter and Compressor: WebP, JPEG, PNG
Pricing
Pay per event
Image Converter and Compressor: WebP, JPEG, PNG
Bulk image converter and compressor: convert image URLs to WebP, JPEG or PNG with a quality setting and optional max width/height. Results land in Apify storage with before/after bytes; source EXIF is not copied. Non-images, duplicates and failures free. $1.50 per 1,000 images. Plus $0.00005 start.
Pricing
Pay per event
Rating
0.0
(0)
Developer
fecklesspleb
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
15 days ago
Last modified
Categories
Features
Share
Image Converter and Compressor
Convert a list of image URLs to WebP, JPEG or PNG (optional max width/height and quality) and save the results to an Apify key-value store. Each converted row records original vs new bytes and dimensions.
At a glance: $1.50 per 1,000 images converted ($0.0015 per image), plus the Apify run-start event. Non-images, duplicates, size/pixel rejects and failures are free.
Scheduled runs skip what was already saved (default). Runs started by an Apify Schedule skip images that an earlier scheduled run already converted and saved with the same output settings, and skipped images are not charged. This creates a named key-value store image-converter-compressor-skip-state in your Apify account (or the name you set in Skip state store name). To opt out, set Skip images converted by earlier runs (skipAlreadyConverted) to never. Manual, API, webhook and integration runs are not affected unless you set it to always.
When to use it
- Convert PNGs/JPEGs to WebP for a CDN or static site.
- Normalise a batch of product images to one format and max size.
- Re-encode screenshots before archiving.
Input
See the input schema. Defaults convert the public Python logo to WebP quality 80 (no resize). Empty urls uses that same sample.
Output
One dataset row per URL (status: converted / failed / skipped). Converted rows include originalBytes, bytes, originalWidth/originalHeight, width/height, format, kvKey, sha256. Converted files live in the key-value store under a content-hash key. EXIF orientation is applied before conversion, and the source EXIF metadata is not copied into the output file.
Dataset fields (converted rows)
| Field | Meaning |
|---|---|
url | Requested image URL. |
status | converted, failed, or skipped. |
finalUrl | URL after redirects. |
contentType | Output MIME type on success (image/webp, image/jpeg, or image/png). |
originalBytes / bytes | Source body length vs converted length. |
originalWidth / originalHeight | Source pixel size from the file header (before EXIF orientation transpose and before resize). |
width / height | Output pixel size after EXIF orientation transpose and optional thumbnail. |
format | Output format (webp / jpeg / png). |
originalFormat | Source format Pillow reported (when available). |
kvKey / fileUrl | Key-value store record name and public URL. |
sha256 | Hex SHA-256 of the converted bytes (also used for de-duplication). |
quality | Quality used for WebP/JPEG. |
charged | true only when the image event was charged. |
reason | Set on failed/skipped rows (for example non-image, oversize, duplicate, robots). |
convertedAt | UTC ISO timestamp. |
A free status row (statusRow: true) is written when no image was converted, and optionally when maxPixels was clamped to the memory-safe ceiling. RUN_SUMMARY in the key-value store repeats counts (saved, duplicates, filtered, failed) plus effective pixel/memory settings (plus alreadyConverted and skipState when the cross-run skip is on, preset with a preset, and inputSources with a dataset or CSV source).
Pricing
apify-actor-start: $0.00005, the standard Apify start event (one per GB of memory, minimum 1).image: $0.0015 per converted image saved to the key-value store ($1.50 per 1,000 images).
Failed, skipped, duplicate and non-image rows are free, and so are images skipped because an earlier run already converted them with the same settings (cross-run skip). Set Maximum cost per run to stop cleanly; an image that cannot be charged is not kept in the store.
Recurring runs: skip images you already have
skipAlreadyConverted | What happens |
|---|---|
auto (default) | On only for runs started by an Apify Schedule. Manual, API, webhook, MCP and integration (n8n, Make, Zapier) runs process every URL, as before. |
always | On for every run. Use it for n8n, Make, Zapier or API jobs that repeat. |
never | Off. Every run converts and charges every image. |
When it is on, every URL is still fetched and hashed. An image whose source bytes (SHA-256) and output settings (outputFormat, quality, maxWidth, maxHeight) match one an earlier run already converted and was charged for is not converted again. It gets a free row with status skipped and a reason that starts already converted by an earlier run, and is not charged. Changing a setting makes every image new again. RUN_SUMMARY counts them and shows the store in skipState; the log and status message say how many were skipped. If nothing new was found, the run also adds the usual free status row, which then starts Not charged: no new image.
The history is kept in a named key-value store in your account, Skip state store name (skipStateStoreName, default image-converter-compressor-skip-state). Use one name per job if separate schedules should not share history. Named stores are kept until you delete them; this one holds about 67 bytes per remembered image (a 64-character hash in a JSON list), so 10,000 images is under 1 MB. Storage is billed by Apify under your plan; we have not measured the cost of such a small store. Delete the store, or pick a new name, to start over. Do not run two runs on the same store at the same moment: one of them may forget the other's newest entries, which only means those images are charged once more later.
Only images that were saved and charged are remembered; failed, filtered and cost-capped URLs are tried again next time.
Other URL sources (dataset, CSV, Google Sheet)
Next to URLs you can add:
- Dataset with URLs (
datasetId): an Apify dataset, for example the output of a scraper run. Each item'surlis used, or the first offileUrl,imageUrl,src,linkorhrefthat holds a URL. SetdatasetUrlFieldfor another field (dots for nested fields, for exampleproduct.image). Lists of URLs in a field are read too. - CSV URL or Google Sheet URL (
csvUrl): a public CSV file, or a Google Sheet shared as Anyone with the link (no Google sign-in). A normal sheet link such ashttps://docs.google.com/spreadsheets/d/<ID>/edit#gid=0is turned into its CSV export URL. The column namedurlis used, or the first column that holds URLs; setcsvUrlColumnto pick a header. Max 5 MB.
Up to 5,000 URLs are taken from the dataset and CSV together, and they are added to the URL list without duplicates. If the URL list is still the default sample (the python.org sample logo), the sample is ignored when a dataset or CSV is set. If a source cannot be read (not found, no access, an HTML sign-in page instead of CSV), its reason is in the status row and RUN_SUMMARY.inputSources, and nothing is charged for it. The CSV is fetched like any other URL: robots.txt is obeyed and private addresses are blocked.
Run it after another Actor: in that Actor's Integrations tab, start this Actor when a run succeeds and pass {"datasetId": "{{resource.defaultDatasetId}}"} as the input.
Presets
preset fills fields you left at their default. A field you changed keeps your value. Each preset caps maxImages, so a preset run costs at most $0.01: start event $0.00005 + images × $0.0015.
preset | Sets | Max cost of a preset run |
|---|---|---|
none (default) | nothing | (your own limits) |
quickSample | maxImages 3 | $0.00005 + 3 × $0.0015 = $0.00455 |
webThumbnails | WebP, quality 75, maxWidth 640, maxHeight 640, maxImages 6 | $0.00005 + 6 × $0.0015 = $0.00905 |
emailJpeg | JPEG, quality 70, maxWidth 1200, maxImages 6 | $0.00005 + 6 × $0.0015 = $0.00905 |
newImagesOnly | skipAlreadyConverted always, maxImages 6 | $0.00005 + 6 × $0.0015 = $0.00905 |
Raise maxImages yourself when you need more; your value wins over the preset.
Run it on a schedule
Use this when you want a maintained list of image URLs re-encoded on a regular cadence, then handed to a CDN, archive or another workflow.
Scheduled runs skip what was already saved (default). Runs started by an Apify Schedule skip images that an earlier scheduled run already converted and saved with the same output settings, and skipped images are not charged. This creates a named key-value store image-converter-compressor-skip-state in your Apify account (or the name you set in Skip state store name). To opt out, set Skip images converted by earlier runs (skipAlreadyConverted) to never. Manual, API, webhook and integration runs are not affected unless you set it to always.
Example. Keep product or screenshot image URLs in the urls field and run it daily or weekly with outputFormat set to webp (or jpeg / png). Converted files are saved in the key-value store; each converted dataset row includes original vs new bytes and dimensions, plus fileUrl. In-run de-duplication is by the SHA-256 of the converted bytes. Runs started by an Apify Schedule also skip images that an earlier run already converted with the same settings, so only new images are converted and charged; see Recurring runs. Set Key-value store name for a named store that is kept indefinitely. Charges are unchanged; see Pricing.
Apify Schedules
You must have run the Actor at least once before you can schedule it. In Apify Console, open Schedules and click Create new. Set a name (3–63 characters) and a timezone (daylight saving is supported). Under Schedule setup, use the visual builder or a cron expression. For example, 0 8 * * * runs every day at 08:00 in that timezone. Click Add, choose this Actor or a saved task, and optionally override the input, build, timeout or memory. If you leave the input empty, the Actor's default input is used. New schedules are created disabled; check the Next runs preview, then click Enable. One schedule can include at most 10 Actors and 10 tasks.
Webhook or dataset hand-off
On the Actor or a task, add a webhook for the event ACTOR.RUN.SUCCEEDED (you can also listen for ACTOR.RUN.FAILED). The event data includes actorRunId. Fetch that run's dataset items:
curl -H "Authorization: Bearer <YOUR_APIFY_TOKEN>" \"https://api.apify.com/v2/actor-runs/<RUN_ID>/dataset/items?format=json"
Keep the token in a credential or secret, never in a URL you share publicly. The API also accepts ?token=, but the Authorization header is the recommended, more secure method. format may be json (the default), jsonl, csv, xlsx, xml or rss.
Each converted file is also in the run's key-value store; use the row's fileUrl, or download from Storage → Key-value store in Console.
n8n
- Install the Apify node: on self-hosted n8n, go to Settings → Community Nodes and install
@apify/n8n-nodes-apify; on n8n Cloud, search for Apify and install the node. - Create an Apify API credential and store
<YOUR_APIFY_TOKEN>there (OAuth2 is also available on n8n Cloud). Do not put the token in a node URL. - Add an Apify Run an Actor node, select this Actor, and set the input JSON below. To get rows in the same step, use Run an Actor and get dataset instead, which waits for the run to finish and returns the dataset items.
- If an Apify Schedule starts the run, use the On new Apify Event trigger (event type Succeeded), then Get Dataset Items with the run's default dataset id.
- Send the items to a sheet, folder or the next node.
Works with Apify's native n8n, Make and Zapier integrations. For a scheduled run, start it from an Apify Schedule or a Schedule Trigger in n8n, then read the run's default dataset in the next node.
Example input for a scheduled run:
{"urls": [{"url": "https://www.python.org/static/img/python-logo.png"}],"outputFormat": "webp","quality": 80,"skipAlreadyConverted": "always","skipStateStoreName": "n8n-weekly-webp"}
n8n starts runs through the API, so skipAlreadyConverted is set to always above; the auto default applies only to runs started by an Apify Schedule.
Make
- In a Make scenario, add the Apify app and connect with OAuth or an API token (store the token in the connection).
- Add Run an Actor, select this Actor, and paste the same input JSON. Set Run synchronously to Yes only if the run will finish inside Make's synchronous timeout (Make's Apify app page states a 120-second maximum; Apify's Make docs say the timeout varies by plan). For longer runs, let an Apify Schedule start the Actor and use Watch Actor Runs, then Get Dataset Items with that run's default dataset id.
- Map the items to Google Sheets, Drive, or the next module.
FAQ
Which input formats work?
Responses whose bytes look like images pass the magic-byte check (JPEG, PNG, GIF, WebP, BMP, ICO/CUR, TIFF, and ISO-BMFF ftyp brands such as AVIF/HEIC). Conversion still needs Pillow to open the file. Formats Pillow cannot decode (typical for HEIC without a HEIF plugin) fail free with a Pillow-open reason. Output is only WebP, JPEG or PNG.
What about animated GIFs?
Only the first frame is converted. The Actor does not write multi-frame WebP/GIF/PNG animations.
Are EXIF, ICC and GPS kept in the output?
No. EXIF orientation is applied (exif_transpose) before resize/encode; the saved file is written without an exif= or icc_profile= argument, so source EXIF (including GPS) and ICC profiles are not copied into the output. This is a conversion Actor, not a metadata pass-through.
What if a URL redirects to a login page?
If there was at least one redirect and the final path looks like a login page (for example login, signin, wp-login) or the body has a password input, the URL fails free with a login-redirect reason (tested locally). Nothing is converted or charged as image.
What counts as “not an image”?
Empty bodies, or bodies without recognised image magic (HTML, JSON, plain text, and similar), fail free. Real image bytes are accepted even when Content-Type is missing or wrong.
How do size and pixel limits work?
Max source file size (default 25 MB, schema max 100) skips oversize downloads free (filtered). Max pixels (default 8,000,000) is checked from the image header before a full decode; oversized images fail free. Runtime always clamps maxPixels to a memory-safe ceiling from Actor memory (~28 bytes/pixel × 45% of MB; about 8.6 MP at the 512 MB default, 4.3 MP at 256 MB). A free warning row explains the clamp when it happens. Raise Actor memory to process larger images.
What is the effective concurrency?
Input default maxConcurrency is 5 (hard cap 20). It is lowered automatically so parallel fetches fit roughly half of Actor memory given maxFileSizeMb. Decodes run one at a time (a single decode slot) regardless of fetch concurrency. HTTP timeout is 30 seconds per request.
Why was a URL not charged?
Only rows with status: converted that were saved to the key-value store raise the image event. Duplicates (same SHA-256 of converted output), size/pixel rejects, non-images, login redirects, HTTP errors, robots.txt blocks, private-address blocks, cost/maxImages skips, invalid input, and status rows are free. If nothing converted, one status row explains why.
What does robots.txt do?
Every request checks robots.txt. Disallowed URLs are not fetched further, count as failed, and are free.
Limits
- Direct image URLs only (no page crawl).
- Responses without recognised image bytes (HTML, JSON and similar) are rejected and free (magic-byte check). A redirect to a login page is rejected and free (tested locally).
- Decompression-bomb guard: input default 8,000,000 pixels, but the Actor always clamps to a memory-safe ceiling from its allocated memory (~28 bytes/pixel × 45% of MB; about 8.6 MP at the 512 MB default, 4.3 MP at 256 MB). Larger requests are reduced, logged and explained in a free warning row; oversized images are rejected from the header before decode (free row). Raise Actor memory to process larger images.
- Max source size default 25 MB (schema maximum 100 MB). Concurrency is capped at 20 and lowered automatically to fit memory; images are decoded one at a time.
- Duplicates are detected by the SHA-256 of the converted output.
- robots.txt respected; private/loopback/link-local addresses blocked on the Apify platform.
- Animated GIFs: first frame only.
- Default run memory is 512 MB (configurable from 256 MB to 4 GB in Actor settings).
Invalid input: if the input is not a JSON object or a field has the wrong type, the run fetches nothing and ends with one free status row (Invalid input, nothing was fetched and no results were charged: …). The Actor start event still applies.
Legal
Download only images you have the right to process. Obey each site's terms and robots.txt.