Image

Image Transparency Flattener

Flatten a transparent image onto a solid colour, a chequerboard or a gradient, so it can be saved as JPEG or used where transparency is not supported.

Last reviewed by the Radiatus Cloud team

Drop an image here, click to browse, or paste one
Everything happens in your browser. Nothing is uploaded anywhere.
Preview appears here.

Need this done properly for your business?

Radiatus delivers secure cloud, DevOps & compliance engineering.

Book a free consult

JPEG has no alpha channel

Saving a transparent PNG as JPEG does not preserve the transparency and does not warn about losing it. The transparent areas are composited onto whatever the encoder happens to use, which is usually black, producing a logo with a black box around it. This surprises people repeatedly because nothing in the process says anything is being discarded. Flattening deliberately, onto a colour you choose, is the fix.

The fringe comes from what was behind the original

Anti-aliased edges are partly transparent pixels whose colour was blended for a specific background. A logo exported over white has edge pixels containing white, so placing it on a dark background leaves a pale halo. This is not a flaw in the flattening; the information about what the edge should look like on a dark background was never in the file. Re-exporting from the source with the correct background is the only complete fix.

Premultiplied alpha is why some images look wrong

Some formats store colour already multiplied by its alpha, so a half-transparent red is stored as a darker red rather than as red with an alpha of one half. Compositing premultiplied data as though it were not, or the reverse, produces edges that are too dark or too light. Canvas works with unpremultiplied values, which is what this uses, and it is the reason a flattened image can differ slightly from what a design tool produces.

Related tools

  • EXIF Viewer — Extract hidden EXIF data (Camera, GPS, Settings) from images.
  • Favicon Generator — Generate favicons and app icons at every required size from one source image, with the exact HTML to reference them.
  • Placeholder Image Generator — Generate placeholder images at any size with custom colours and label text. Produced in your browser as downloadable files, no external hotlinking.
  • Image Resizer — Resize images in your browser with aspect ratio control and format conversion. Files are processed locally and never uploaded.

Frequently Asked Questions

Why does my transparent PNG have a black background as JPEG?

Because JPEG has no alpha channel and the encoder composites transparency onto a default colour, usually black, without warning. Flattening onto a colour you choose first avoids the surprise.

Why is there a pale halo around my logo?

Because its anti-aliased edge pixels were blended with the background it was exported over, usually white, and that white is baked into them. Placing it on a dark background reveals it, and only re-exporting from the source fixes it completely.

Should I flatten onto white or transparent?

Keep transparency if the format supports it and the background varies. Flatten when the target format has no alpha, when the file must be smaller, or when the background is known and fixed.

Does flattening reduce file size?

Usually yes for PNG, since an image without an alpha channel needs one less byte per pixel and compresses better. It also allows JPEG or lossy WebP, which are much smaller again for photographic content.

What is premultiplied alpha?

Colour values already multiplied by their transparency, stored that way for faster compositing. Mixing premultiplied and unpremultiplied data produces edges that are too dark or too light, which is why a flattened result can differ slightly between tools.

Privacy & Security

Everything runs in your browser; nothing is uploaded.

Data: None
Client-side-Side
Active
v1.0

How to Use

Upload an image with transparency and choose what to composite it onto.

Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.