Skip to content
Mb2KbSizer

File formats

Compress a PNG Without Losing Its Transparent Background

Keep a logo or cutout transparent while reducing its size. Learn which output format to choose, what PNG can shrink, and how to check edge quality.

By Naveed Published 5 min read

A logo looks fine in the download preview, but after you place it on a dark website header, a white rectangle appears around it. The file became smaller, yet an essential part of the asset changed: the background is no longer transparent.

For a logo, signature cutout or product cutout, successful compression means keeping the right background behavior as well as reducing bytes. The output format matters before the target size does. This guide explains the choices in Mb2KbSizer and a practical review process that catches unwanted backgrounds and damaged edges before you publish an asset.

Confirm that the source is actually transparent

Open the original in an editor that shows transparent areas with a checkerboard. A white canvas in a viewer does not tell you whether the underlying pixels are transparent or solid white. The viewer may simply be placing the asset on a white surface.

If you are working on a website, try the original against both a light and a dark background. Look around the outside edge and inside enclosed letter shapes. A logo can have transparent outer space but still contain white patches inside the lettering because it was exported incorrectly.

Do this check before compression. If the source already contains a solid rectangle, the compressor will not turn it into a clean cutout. Background removal is an editing operation, and this website does not currently provide an automatic background-removal tool.

Choose an output that supports transparency

PNG supports transparency, and WebP can also store transparent pixels. JPEG does not. MDN’s format guide makes this distinction explicit; it is a format capability, not a setting that a JPEG quality slider can switch on.

In Mb2KbSizer, open the format and dimensions options and select PNG when the destination requires a PNG file. If your destination accepts WebP, you can try that output as another candidate. Check the receiving application’s accepted formats first; a small, transparent WebP is not useful when the upload field only accepts PNG.

Avoid relying on Auto for a transparent PNG here. The current automatic output choice generally uses JPEG for sources other than WebP. When this tool encodes JPEG, it fills the canvas with white before drawing the image. That is helpful for ordinary opaque photos but will flatten a transparent background.

Changing the filename afterward does not fix this. A file named logo.png can still contain JPEG data if someone merely renamed it. Always convert from the original using the actual output selector and check the downloaded format.

Understand why PNG does not behave like JPEG

JPEG and lossy WebP can trade visual detail for file size. PNG’s usual browser export is lossless, so the encoder does not offer the same quality trade-off. MDN documents the canvas quality parameter for formats that support lossy encoding; passing a lower number is not a universal way to shrink PNG.

This matters when a target is ambitious. A large transparent design with gradients and many colors may not fit into 20 kB at its original dimensions. The tool may need to reduce the pixel dimensions, or report a result that does not reach the requested target when dimensions are locked.

Lossless also needs careful interpretation. Saving the final pixels as PNG does not undo an earlier resize. A smaller version can use lossless PNG encoding while still containing less detail than the high-resolution original because it has fewer pixels. Review both dimensions and file size in the result.

Resize for the place where the image will appear

A small navigation logo rarely needs the same bitmap dimensions as a print asset. Find its display size in the destination layout, then choose a sensible export size that stays sharp on the screens you intend to support. Keep the larger original as your editable master.

As a working example, suppose a logo is displayed at 180 by 60 CSS pixels. You could compare a 360 by 120 pixel version for a screen with twice that pixel density. This is a planning example, not a guarantee that every logo needs those dimensions or will fit a particular byte limit.

Maintain the aspect ratio unless the destination explicitly requires a crop. Stretching a wide logo into a square changes the design. If you need a square avatar, prepare an appropriate square composition in an editor first, with deliberate spacing around the logo, rather than forcing a crop that cuts off letters.

Keep the original open or saved separately, then follow this sequence:

  1. Confirm transparency on the original against a contrasting background.
  2. Check whether the destination accepts PNG, WebP or both.
  3. Add the original to the image compressor.
  4. Explicitly select the output format and any required dimensions.
  5. Set a target that reflects an actual upload limit or your page budget.
  6. Download the result and inspect it in the destination layout.

If the destination has no strict byte limit, use visual quality to decide when to stop. Chasing an extremely small number can make thin letters jagged or soften the edges of a product cutout. If it does have a strict limit, preserve the constraints that matter: accepted format, transparency and required dimensions all need to pass together.

When comparing a second attempt, start from the original again. Do not use a JPEG-flattened intermediate file as the input for your transparent PNG attempt; the missing transparency is already gone from that intermediate.

Check edges as carefully as the background

Place the output on white, black and the actual site background. Look for a pale halo around a dark logo or a dark fringe around a light cutout. Partially transparent edge pixels can reveal problems that are almost invisible on the preview’s default background.

Check fine letter strokes, curved outlines and small spaces between shapes. Inspect at the intended display size as well as zoomed in. The relevant question is whether the asset looks clean where it will be used, not whether it survives unlimited magnification without a visible pixel.

For a product cutout, look at soft edges such as hair or fabric. For a signature image, inspect the thinnest strokes. If an important stroke disappears after resizing, use larger dimensions or a less aggressive target rather than accepting the file simply because it is below the limit.

Keep separate delivery and master files

Use a descriptive download name that identifies the purpose, such as logo-header-transparent.png. Keep the original design or high-resolution export separately. That makes the next website redesign or print request easier and avoids repeatedly enlarging an asset that was prepared for a tiny screen position.

For photographs without transparency, JPEG may be a useful choice; for transparent assets, choose deliberately. The format comparison guide covers the broader trade-offs, while this workflow focuses on one acceptance test: the smaller image must still behave correctly on the background where people will see it.

  • #PNG compression
  • #transparency
  • #logo optimization
  • #WebP

Naveed

I build and test the compressor on this site and write practical guides around the file-size problems it solves. Portal limits are checked against official notifications and dated when I review them. About us

Good to know

Frequently Asked Questions

Why did my transparent PNG get a white background?

The output may have been converted to JPEG, which cannot store a transparent background. Mb2KbSizer fills transparent areas with white when encoding JPEG. Return to the original transparent file and explicitly choose PNG or a supported WebP output.

Can I make a large PNG exactly 20 kB without changing it?

Not always. Lossless PNG must preserve its encoded pixels, and an arbitrary small limit may require fewer pixels or another format. If exact dimensions and transparency are both required, compare the result carefully and accept that some targets may be unreachable.

Does renaming a JPG to PNG bring transparency back?

No. Renaming changes the filename, not the image data. Once a solid background has been baked into a JPEG, changing the extension does not reconstruct the original transparent pixels. Use the original asset or edit its background separately.

What is Mb2KbSizer and what does it do?

Mb2KbSizer is a free image and PDF compressor that runs inside your web browser. You pick a file, type the size you need, such as 100 kB, and it shrinks the file to land at or just under that number. Most people use it for upload forms that reject big files: exam registrations, passport and visa applications, job portals, bank KYC and college admissions. It is just as handy for lightening photos before you email them or put them on a website. There is a [single-image tool](/), a bulk compressor for up to 200 photos at once, and a PDF compressor, all built on the same no-upload principle.

Do I need to install any app to use Mb2KbSizer?

No installation is needed. Mb2KbSizer is a web page, so it works the moment it loads in current Chrome, Edge, Firefox, Safari or Samsung Internet on a phone, tablet or computer. Nothing is downloaded to your device except the page itself, and it does not ask for storage or camera permissions. If you use the tool often, you can add it to your phone's home screen from the browser menu and it will open like an app. It still needs an internet connection to load, though, so treat this as a shortcut rather than an offline program. There is no Play Store or App Store version.

What image formats does Mb2KbSizer support?

You can upload JPG, PNG, WebP, GIF (the first frame is used), BMP and AVIF, provided your browser can decode the file. HEIC photos from an iPhone open in Safari and other browsers with HEIC support; elsewhere the tool explains how to set the camera to Most Compatible so new shots are saved as JPG. Files up to 60 MB are accepted. For output, Auto gives a JPG in most cases and keeps WebP as WebP; you can also force JPG, WebP or PNG. PNG is lossless, so a PNG target is reached only by reducing dimensions, which is why JPG is the better pick for a small photo.

Ready to Compress Your Images?

Select PNG or an accepted WebP output explicitly when transparency matters.

Compress a transparent image