PNG to JPG Converter

Uploads a PNG, alpha-composites any transparent or semi-transparent pixels onto a solid background color (since JPEG has no alpha channel), and re-encodes the result as a JPEG using the browser's own canvas encoder, entirely client-side. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

This tool converts a PNG image to JPG format directly in your browser, handling the one real complication in that conversion: PNG supports transparency and JPEG doesn't.

Rather than letting the browser silently discard or mishandle alpha data, it explicitly flattens transparent pixels onto a background color you control before encoding.

What Is PNG to JPG Converter?

A client-side PNG-to-JPG converter that reads an uploaded PNG's pixel data, composites it onto a solid background wherever it's transparent, and hands the fully opaque result to the browser's native JPEG encoder.

It supports both a default white background and any custom RGB color you specify.

How PNG to JPG Converter Works

Every pixel's RGB channels are alpha-blended against the chosen background color proportional to that pixel's original alpha value, then the alpha channel is forced to fully opaque.

The flattened pixel buffer is painted to a canvas and exported via canvas.toBlob with the image/jpeg MIME type, which triggers the browser's built-in JPEG encoder.

When To Use PNG to JPG Converter

Use it when you need a smaller file size than PNG typically produces for photographic content, or when a downstream system only accepts JPEG.

It's also useful for previewing exactly how a transparent PNG will look once flattened onto a solid background.

Features

Advantages

  • Runs entirely client-side; your image is never uploaded to a server.
  • Explicit, visible control over the background color used to flatten transparency, rather than an unpredictable default.
  • Uses the browser's native JPEG encoder, so output compatibility matches what any browser can already decode.

Limitations

  • JPEG compression is lossy, so fine detail and hard edges (like text or line art) can show visible artifacts.
  • Once flattened, the original transparency information is permanently lost in the JPEG output.

Examples

Convert a logo with a transparent background

Input

A 500x500 PNG logo with transparent corners

Output

A 500x500 JPG with the corners filled solid white

The default white background fills in what was previously transparent.

Convert onto a custom background

Input

A PNG icon, background color set to #003366

Output

A JPG with the formerly transparent areas filled in dark blue

Any RGB background color can be supplied instead of the white default.

Best Practices & Notes

Best Practices

  • Pick a background color that matches where the JPG will actually be displayed, so the flattened edges blend in.
  • Use a higher quality setting for photos with fine detail and a lower one when file size matters more than fidelity.

Developer Notes

The alpha-flattening math lives in a pure lib function operating on a plain Uint8ClampedArray pixel buffer (no DOM); only the component touches an actual <canvas> to decode the upload and drive the JPEG encoder via canvas.toBlob's image/jpeg MIME type.

PNG to JPG Converter Use Cases

  • Shrinking a PNG screenshot's file size for email or upload limits
  • Preparing a transparent graphic for a platform that only accepts JPEG
  • Flattening a design mockup onto its intended background color before export

Common Mistakes

  • Forgetting that JPEG can't preserve transparency, then being surprised the exported file has a solid background.
  • Using a very low quality setting on images with sharp text or line art, which shows JPEG's blocky compression artifacts most visibly.

Tips

  • If you need to keep transparency, use a WebP export instead of JPG.
  • Preview the flattened result before downloading, since the background color changes the final look.

References

Frequently Asked Questions