PNG to JPG Converter - WebP, AVIF and More avatar

PNG to JPG Converter - WebP, AVIF and More

Under maintenance

Pricing

Pay per usage

Go to Apify Store
PNG to JPG Converter - WebP, AVIF and More

PNG to JPG Converter - WebP, AVIF and More

Under maintenance

Convert PNG to JPG online in seconds. Also converts WebP, AVIF, JFIF, BMP, TIFF and GIF in any direction. Transparency is flattened onto a background colour you choose rather than silently onto black. Up to 100 images per run, with resize and quality.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Marcel Rebro

Marcel Rebro

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Share

Convert PNG to JPG online, plus WebP, AVIF, JFIF, BMP, TIFF and GIF, in any direction. Convert one image or a whole folder of up to 100 in a single run, and get a ZIP back. Transparent backgrounds are flattened onto a colour you choose rather than the black most converters leave you with.

Every one of these formats exists because it is better than the others at something, which is why none of them won and why you keep having to convert between them. PNG carries transparency and no compression artefacts. JPG opens in absolutely everything. WebP and AVIF are a third the size but only if whatever is receiving them understands them. This converter is the boring step in between.

  • πŸ–ΌοΈ Eight formats in, six out - PNG, JPG, JFIF, WebP, AVIF, BMP, TIFF and GIF in; JPEG, PNG, WebP, AVIF, TIFF and BMP out
  • πŸ“ Converts a whole folder in one run - up to 100 images, returned as a single ZIP, for roughly what one image costs
  • 🩢 Transparency handled properly - JPG cannot store a transparent background, so choose the colour it becomes instead of discovering it went black
  • 🎨 Fixes oversaturated wide-gamut images - a real sRGB conversion, not a relabelling
  • πŸ“ Strips GPS and EXIF on request - one switch before you share a photo publicly
  • πŸ“ Resizes while it converts - cap the long edge without a second tool
  • πŸ’Έ Costs a fraction of a cent per image
  • πŸ”Œ Runs from the API, a schedule or an integration - it is an Apify Actor, so Zapier, Make, n8n and MCP clients can call it

Converting photos off an iPhone? Those are HEIC files, and the HEIC to JPG converter is the Actor built for them - it handles bursts and Live Photo stills, which this one does not. This Actor is the web-formats one.

How to convert PNG to JPG

  1. Click Try for free and sign in to Apify.
  2. Upload your .png file in the Images field, or paste a direct URL to it. You can add up to 100 files here.
  3. Leave Convert to on jpeg, or pick another format.
  4. If your PNG has a transparent background, set Background colour to whatever it should become. The default is white.
  5. Click Start, then download the JPG from the Storage tab or from the download URL in the run's dataset record.

How to batch convert a folder of images

Add every file to the Images field - up to 100 per run - and start the run. Each image is converted separately with the same settings, and:

  • Every converted image lands in the run's storage under its own filename.
  • They are also packed into one images.zip, which is what the Output tab and the API hand back, so you download once rather than a hundred times.
  • The run's dataset gets one record per input file, with an ok flag, so you can see at a glance what converted and what did not.

One bad file does not spoil the batch. A PDF that slipped into the folder, a URL that 404s or a truncated download is recorded against that file with the reason and the run carries on. The run only fails if nothing at all converted. Two files called IMG_0001.png from two different folders both come out, as IMG_0001.jpg and IMG_0001-2.jpg, rather than one silently replacing the other.

This is also much cheaper than running the Actor once per file - see the cost section.

How to convert WebP to JPG

Upload a .webp file and leave Convert to on jpeg. WebP is what image CDNs and modern sites serve, so it is what you get when you save a picture from a web page - and then Word, older Photoshop and half the upload forms on the internet refuse it. A WebP can be transparent, so set the background colour if it is.

How to convert WebP to PNG

Same file, set Convert to to png. This is the conversion to choose when the WebP has a transparent background you need to keep: PNG stores transparency and JPG does not. It is also lossless, so nothing is re-compressed on the way through - the file will be considerably larger.

How to convert AVIF to JPG

Upload an .avif file and leave Convert to on jpeg. AVIF is the newest of these formats and the smallest at a given quality, which is exactly why software that is more than a couple of years old cannot open it. AVIF supports transparency, so the background colour applies here too.

How to convert PNG to WebP

Set Convert to to webp. This is the conversion for making a page faster: WebP is meaningfully smaller than PNG at the same visible quality and every current browser reads it. Transparency survives, so a logo stays a logo. Drop Quality to around 80 if size matters more than the last sliver of detail.

How to convert JFIF to JPG

Upload the .jfif file and leave Convert to on jpeg. Worth knowing what you are actually converting: a .jfif file is already a JPEG. JFIF is the interchange format JPEG has been wrapped in since 1992, and some versions of Windows and some email clients simply save it under that extension instead of .jpg. Nothing about the image changes - this conversion re-writes the file with the extension everything else expects. The Actor reads the header rather than the filename, so it reports what the file genuinely is in the run's dataset record.

How to convert JPG to PNG

Set Convert to to png. Useful when something downstream insists on PNG, or when you want a lossless copy to edit without accumulating JPEG artefacts every time you save. It cannot undo compression that has already happened: a PNG made from a JPG is a perfect copy of an imperfect image, and it will be several times larger.

Converting BMP, TIFF and GIF

All three go through the same path. BMP and TIFF are the formats that turn up from scanners, medical software and anything descended from Windows 95; GIF is a picture with at most 256 colours. Any of them convert to any of the six output formats.

What happens to transparency when you convert PNG to JPG?

This is the thing most converters get wrong, so it is worth being explicit.

PNG, WebP, AVIF, TIFF and GIF can all store a transparent background. JPEG cannot - the format has no alpha channel and never has. So converting a transparent image to JPG is not a conversion, it is a decision: something has to go behind the picture.

Most tools make that decision by accident. The transparent pixels are usually stored as black with an alpha value of zero, so dropping the alpha channel reveals black, and the logo you converted comes back on a black rectangle. This Actor flattens onto white by default and lets you pick any other colour with the backgroundColor input. A colour name, #ffffff, or rgb(255,255,255) all work, and a colour ImageMagick does not recognise stops the run with an explanation instead of quietly falling back to black.

Three consequences worth knowing:

  • BMP output is flattened too. 32-bit BMP can technically carry transparency, but a great many of the old Windows applications people choose BMP for render it as a black rectangle. Anyone picking BMP is picking it for compatibility, so this Actor gives them the compatible thing.
  • PNG, WebP, AVIF and TIFF output keep transparency exactly as it was, and backgroundColor is ignored. The run log says so when you set it anyway.
  • transparent is not a valid background colour for JPG output. It is accepted by ImageMagick and produces black, so the Actor refuses it and tells you to choose PNG or WebP instead.

The run's dataset record reports sourceHasAlpha, alphaFlattened and the backgroundColor used, so you can tell after the fact whether a conversion made that decision for you.

Input

Upload the files in the Images field, or pass direct URLs to them.

FieldDescription
filesThe images to convert, up to 100. File uploads or URLs.
fileOne image, as a URL. A hidden alias kept so existing API callers keep working; ignored when files is set.
outputFormatjpeg (default), png, webp, avif, tiff or bmp.
quality1 to 100, default 90. Used by JPEG, WebP and AVIF; ignored by the lossless formats.
backgroundColorWhat transparent areas become when the output cannot store them. white by default.
maxDimensionShrink so neither side exceeds this many pixels. Never enlarges.
keepMetadatatrue by default. Set to false to strip EXIF, XMP and IPTC.
stripToSRGBConvert into sRGB and drop the embedded colour profile. false by default.
outputFilenameDefaults to the input filename. Single-image only; ignored for a batch.
fileBase64, filenameThe file as base64, for API callers who prefer JSON to a URL.
verboseLogInclude the full ImageMagick output in the Actor log.

Does the converted image keep EXIF, GPS and camera data?

keepMetadata is on by default, because silently discarding the date a photo was taken is the more surprising behaviour. Note what that means for phone photos: the EXIF block carries the camera model, the timestamp and, if location services were on, the GPS coordinates where the photo was taken. Turn keepMetadata off before sharing images publicly.

Stripping metadata deliberately keeps the ICC colour profile. Removing that too would visibly shift the colours of wide-gamut images, which is not what anyone means by "strip the metadata". It also removes the timestamps ImageMagick writes into PNG files of its own accord, which a naive strip leaves behind.

My PNG looks washed out or oversaturated after converting

Turn on stripToSRGB. Images from an iPhone, a modern camera or Photoshop are frequently in a wide-gamut colour space - Display P3 or Adobe RGB - and carry a profile telling viewers how to interpret them. Software that ignores that profile shows the numbers as though they were sRGB, and the result is either garish or flat depending on which way the mismatch runs.

stripToSRGB performs a real colour-managed conversion into sRGB and then removes the profile, so the pixels themselves are correct and nothing downstream has to interpret anything. It is off by default because it is a lossy narrowing of the colour range, and an image already in sRGB gains nothing from it.

Output

Every converted image is written to the run's key-value store under its own filename, so it is downloadable from the Storage tab. What lands under OUTPUT - which is what the Output tab shows and what run-sync returns in its HTTP response body - depends on how many files went in:

InputOUTPUT holds
One imagethe converted image itself
Several imagesimages.zip, containing every converted image
Several images totalling over 192 MBMANIFEST.json, listing every image with its key, size and URL

That last row exists because the ZIP is assembled in memory before it is uploaded. Past a couple of hundred megabytes of output, building it would cost more memory than the conversion did, so the run lists the results instead. Every image is still in storage under its own name either way.

The dataset gets one record per input file, each with an ok flag, the detected source format, dimensions, file sizes, how transparency was handled and the download URL. A file that failed gets a record too, with ok: false and the reason in error. Records are written as each file finishes, so a run that dies at file 80 still has the first 79 results.

Note that the source format in that record comes from reading the file's header, not its extension. A .jfif is reported as JPEG, and a .png that is secretly a JPEG is reported as what it is, with a warning in the log.

How much does it cost to convert PNG to JPG?

JobRun timeCost
One 2 MP PNG6.8 s$0.0006
50 PNGs in one run120 s$0.011, or $0.0002 each

Measured 2026-08-26 on the Free plan at the default 1024 MB, read back from the run API.

An image costs a fraction of a cent, and Apify's free plan includes $5 of usage a month - tens of thousands of images.

Batch, but for the right reason. A run spends about four seconds starting the container before it converts anything, and that is paid once per run however many files it handles. Fifty images as fifty separate runs costs around $0.030; the same fifty in one run costs $0.011. So batching is roughly three times cheaper - a real saving, but not the hundred-fold one you might expect, because past the startup each image still costs its own couple of seconds of conversion.

Compute is a little over half the bill. The rest is key-value store writes and data transfer, which scale with the number of output files rather than with run time.

Leave the memory at the default 1024 MB. Apify allocates one CPU core per 4096 MB, and a conversion this short is not CPU-bound long enough for extra cores to pay for themselves. Raise it only for very large images converted to PNG or TIFF, where the uncompressed pixel buffer is the constraint.

How to convert PNG to JPG with the API

run-sync returns the image in the response body:

curl -X POST \
"https://api.apify.com/v2/acts/marcel-rbro~png-to-jpg/run-sync?token=<TOKEN>" \
-H 'Content-Type: application/json' \
-d '{"file": "https://example.com/logo.png", "outputFormat": "jpeg", "quality": 90, "backgroundColor": "white"}' \
--output logo.jpg

A whole folder in one run, which returns the ZIP:

curl -X POST \
"https://api.apify.com/v2/acts/marcel-rbro~png-to-jpg/run-sync?token=<TOKEN>" \
-H 'Content-Type: application/json' \
-d '{"files": ["https://example.com/a.png", "https://example.com/b.webp"], "outputFormat": "jpeg"}' \
--output images.zip

WebP to PNG, keeping the transparency:

curl -X POST \
"https://api.apify.com/v2/acts/marcel-rbro~png-to-jpg/run-sync?token=<TOKEN>" \
-H 'Content-Type: application/json' \
-d '{"file": "https://example.com/icon.webp", "outputFormat": "png"}' \
--output icon.png

If you hold the bytes rather than a URL, pass them as base64 in fileBase64. The Apify API requires Actor input to be application/json, so posting the image as a raw request body is rejected with HTTP 400 before the run starts - a URL or base64 are the two ways in:

curl -X POST \
"https://api.apify.com/v2/acts/marcel-rbro~png-to-jpg/run-sync?token=<TOKEN>" \
-H 'Content-Type: application/json' \
-d "{\"fileBase64\": \"$(base64 < logo.png)\", \"filename\": \"logo.png\"}" \
--output logo.jpg

Base64 adds about a third to the payload, so prefer a URL for large files.

run-sync waits up to 300 seconds, which no ordinary image will come close to using. There are client libraries for JavaScript and Python, and the same run can be triggered on a schedule or from Zapier, Make, n8n, Slack or an MCP client.

Limitations

  • 100 images per run, and the run is capped at 512 MB of input in total, 100 MB for any one file, 100 MP for any one image and 2 GP across the whole run. Anything larger is refused with a message naming the limit rather than timing out halfway through. Split the batch and run it again for the rest.
  • Every image in a run gets the same settings. One output format, one quality, one background colour. Converting some files to PNG and others to JPG means two runs.
  • Over 192 MB of output comes back as a manifest rather than a ZIP. The archive is built in memory, so past that point the run lists the results instead of packing them. The images themselves are in storage either way.
  • Downloads are given 120 seconds each. A URL that hangs is recorded as a failure for that file rather than stalling everything queued behind it.
  • Animated images convert their first frame only. An animated GIF, an animated WebP or an APNG becomes a single still image, and the run log says so. None of the output formats here store animation.
  • No vector input. SVG is a drawing rather than a grid of pixels, and rasterising one needs a renderer this Actor does not carry. Uploading one fails with an explanation rather than a delegate error.
  • No PDF, in or out. Use PDF to JPG and JPG to PDF for those directions.
  • HEIC works, but is not what this Actor is for. A .heic file uploaded here converts, with a note in the log pointing at the HEIC to JPG converter, which handles bursts, Live Photo stills and multi-image containers that this one does not.
  • Format availability is asserted at build time. Reading and writing all seven formats is checked when the image is built, along with a round trip proving the alpha channel survives every format that claims to store one. A delegate library that quietly loses a codec fails the build rather than every run.

Other file converters

ActorConvertsUse it for
PNG to JPG converter (this one)PNG, JPG, JFIF, WebP, AVIF, BMP, TIFF, GIF β†’ JPEG, PNG, WebP, AVIF, TIFF, BMPWeb and desktop image formats
HEIC to JPG converterHEIC, HEIF, AVIF β†’ JPEG, PNG, WebP, AVIF, TIFFiPhone photos, bursts and Live Photo stills
PDF to JPG converterPDF β†’ JPEG, PNGTurning pages into images
JPG to PDF converterJPEG, PNG β†’ PDFTurning images into a document
Word to PDF converterDOC, DOCX β†’ PDFOffice documents
MOBI to EPUB converterMOBI, PRC, AZW, AZW3 β†’ EPUBKindle ebooks
EPUB to PDF converterEPUB β†’ PDFEbooks for printing

The overlap with the HEIC Actor is only AVIF, and it is deliberate - both read it. Everything else is a clean split: that one is for the HEIF family your phone produces, this one is for the formats the web runs on.

FAQ

Is this PNG to JPG converter free?

Apify's free plan includes $5 of platform usage per month and needs no card. At a fraction of a cent per image, that covers a great many conversions before you pay anything.

What happens to a transparent background?

It becomes the colour you set in backgroundColor, which defaults to white, whenever the output format cannot store transparency - that means JPG and BMP. PNG, WebP, AVIF and TIFF output keep it untouched. The full explanation is in the transparency section above.

Does converting PNG to JPG lose quality?

Yes, in two ways. JPEG is lossy, so the encode discards detail - at the default quality of 90 that is invisible at normal viewing sizes. And it drops the alpha channel, which is not recoverable at all: once a transparent background has been flattened onto white, converting back to PNG gives you a white background, not a transparent one. Keep the original if you might need it.

Going the other way, JPG to PNG, loses nothing on the conversion itself, but it cannot repair compression the JPEG already applied.

WebP, AVIF or JPG - which should I use?

Roughly, in order of age:

  • JPG is thirty years old, has no transparency, and opens in literally everything. Choose it when you do not control what will open the file.
  • WebP is meaningfully smaller than JPG at the same visible quality, supports transparency, and is read by every current browser and most current software. Choose it for the web.
  • AVIF is smaller again, supports transparency, and is the one most likely to be refused by whatever you hand it to. Choose it when you know the receiving end is modern.

PNG is not really in that comparison: it is lossless, so it is the right answer for logos, screenshots and diagrams, and the wrong answer for photographs, where it produces enormous files.

Is JFIF the same as JPG?

Yes. JFIF is the container JPEG data has been stored in since 1992, and .jfif is simply a different extension for the same file - some Windows versions and email clients save it that way. Renaming it to .jpg usually works. Converting it here re-writes the file properly and tells you what the header actually says, which is useful when the file turns out not to be a JPEG at all.

Why is my JPG larger than the PNG it came from?

Because PNG compresses flat colour extremely well. A logo, a screenshot or a diagram is mostly large areas of identical pixels, which is the case PNG was designed for and the case JPEG is worst at - JPEG also has to spend bits inventing texture where the image had none. For that kind of image, PNG or WebP is the smaller and better-looking choice, and converting to JPG is only worth it when something downstream demands JPG.

For photographs the relationship reverses, and JPG is dramatically smaller.

Can I convert a batch of images?

Yes, and it is the cheapest way to use this Actor. Put up to 100 files in the Images field and they are all converted in one run, coming back as a single images.zip. Because container startup is most of what a run costs, a batch of 100 costs roughly what one image does - converting a folder as 100 separate runs pays that startup 100 times for no reason.

One bad file does not spoil the batch: it is recorded against its own dataset record with the reason and the run carries on. The run only fails if nothing converted at all.

Can an AI agent call this converter?

Yes. Every Apify Actor is exposed through the Apify MCP server, so Claude, Cursor and other MCP clients can run this conversion as a tool. The Actor's input schema is what the agent sees, so files, outputFormat and backgroundColor are available to it without any extra wiring - an agent can hand it a list of URLs and get one archive back.

Should I use this or the HEIC to JPG converter?

If the file came off an iPhone, or has a .heic, .heif or .hif extension, use the HEIC to JPG converter. It is built for that family and handles bursts and multi-image containers. For anything that came off the web or out of an image editor - PNG, JPG, WebP, AVIF, JFIF, BMP, TIFF, GIF - use this one. AVIF works in both.

The conversion failed. What now?

Turn on verboseLog and re-run: the Actor log will carry ImageMagick's own error. The Actor reads the file header before converting, so most bad inputs are named rather than guessed at - a PDF, an SVG, an HTML error page returned by a URL, or a video file are all reported as what they are. The remaining common causes are a truncated upload and a backgroundColor that is not a colour.

Development

npm install
npm test # tests the header inspector, the batch budgets and the ZIP writer; no ImageMagick needed
apify run # needs ImageMagick on your PATH

Conversion runs ImageMagick in a Debian container. The image is built on Debian trixie rather than bookworm on purpose: bookworm's ImageMagick 6 is built against libheif 1.15.1, which cannot carry an alpha channel through AVIF in either direction, so a transparent AVIF converted to JPG came out black. Trixie's ImageMagick 7 against libheif 1.19.8 handles it, and matches the version most people have locally, so apify run behaves the same as the deployed image. The Actor detects magick or convert at startup, so either version works.

This Actor's code is MIT licensed. ImageMagick and its delegate libraries run as separate processes under their own licences - see THIRD_PARTY_NOTICES.md.