Images guide

JPG vs PNG vs WebP: File Size and Transparency

Compare JPG, PNG and WebP for photos, transparent backgrounds and file size. See measured results from 20 source images and learn what the test cannot show.

By VIPremier ToolsUpdated About 4 min read

Start with what the image needs

JPG is commonly used for photos. PNG preserves lossless pixel data and transparency. WebP supports compressed photo-style images and can also support transparency. The smallest choice depends on the particular image and export settings.

If transparent areas must stay transparent, avoid a JPG output. In the VIPremier image tools, transparent areas are filled white when you export as JPG.

Compare files made from the same source

Our format test exported each of 20 JPG originals as JPG and WebP at quality 80 and as PNG with the browser’s PNG encoder. The pixel dimensions stayed the same. This makes the resulting file sizes comparable within this test, although the lossless PNG output does not share the same quality setting.

Use the measured table to inspect the results image by image. Do not assume that one format wins for every photograph, graphic or browser.

Choose, export and check

Pick the format your destination accepts, export the image, then inspect the actual file and its visual quality. A format conversion can produce a larger file; the extension alone does not tell you its size.

Resize and export step by step

Open the Free Image Resizer and choose a file under “Choose an image or drop it here”. The page shows the original dimensions and file size and fills “Width (px)” and “Height (px)” with the original numbers. Type your own values, or press a button under “Size presets”: 1:1 (1080 × 1080), 4:5 (1080 × 1350), 16:9 (1280 × 720) or 9:16 (1080 × 1920), plus labeled examples such as “YouTube thumbnail example 1280×720”. The page itself says platform presets are editing examples, so check the destination’s current requirements.

Pick a “Fit mode”: “Keep original ratio”, “Fit whole image (add space)” or “Center crop (trim edges)”. Press “Preview resized image” and read the “Output dimensions” line. Then press “Download JPG”, “Download PNG” or “Download WebP”. All three buttons export the same preview, so one pass gives you three files to compare in your file manager. Each file name ends with the output size, for example “-1080x810”, followed by the extension. If you change a size or the fit mode afterwards, the preview is cleared and you need to press “Preview resized image” again.

JPG and WebP files from this tool are saved at a fixed internal quality of 0.92, and PNG has no quality setting, so there is no slider here. To compare quality levels, use the Image Compressor instead.

Working out the fit modes by hand

Suppose a source image is 4,000 × 3,000 pixels and you enter 1,080 × 1,080. This is an invented example for practice. “Keep original ratio” uses the smaller of two scale factors: 1,080 ÷ 4,000 = 0.27 and 1,080 ÷ 3,000 = 0.36. It multiplies both sides by 0.27 and outputs 1,080 × 810. The numbers you type act as a box the image must fit inside, so one side can end up smaller than what you entered.

“Fit whole image (add space)” makes the output exactly 1,080 × 1,080 and places the same 1,080 × 810 picture in the middle, leaving (1,080 − 810) ÷ 2 = 135 empty pixels above and below. Those empty bands are transparent in PNG and WebP and white in JPG.

“Center crop (trim edges)” uses the larger factor, 0.36, to scale the image to 1,440 × 1,080 and then trims (1,440 − 1,080) ÷ 2 = 180 pixels from the left and from the right of the output. Look at the preview to make sure nothing important sat near those edges.

Mistakes that change the result

Check these before you download, because each one changes the result.

  • Enlarging a small image. If you enter bigger numbers than the original, the tool stretches the picture. An 800 × 600 image kept in ratio inside 1,080 × 1,080 is scaled by 1.35, the smaller of 1,080 ÷ 800 = 1.35 and 1,080 ÷ 600 = 1.8, and becomes 1,080 × 810. The extra pixels are made from the existing ones, so the picture does not gain sharpness.
  • Sending a transparent image to JPG. JPG cannot store transparency, so transparent areas, and any space added by “Fit whole image (add space)”, turn white. If you need a particular background color, add it in an image editor first.
  • Entering sizes outside the limits. Width and height must be whole numbers from 1 to 8,192, and the total must stay within 25 million pixels. For example, 8,192 × 8,192 is 67,108,864 pixels, so the tool shows an error instead of a preview. The input file also has to be within 20 MB and 25 million pixels.
  • Treating presets as platform rules. The preset buttons are common shapes, not a promise about what any site currently requires. Check the destination’s own instructions before publishing.
  • Pressing a download button your browser cannot handle. If the browser cannot write the format you chose, the tool says so and does not download a file. Try one of the other two buttons.

When switching formats is the wrong fix

If the recipient names a format, use that one. Some print shops and older programs may not open WebP, so ask before you send it. Keep your first, unedited file as the master instead of saving JPG over JPG.

Screenshots with small text and logos with crisp edges can look softer after a lossy JPG or WebP export. Export a PNG as well and compare them at full size before you decide. If your goal is only a smaller file at the same dimensions, the Image Compressor is the better tool; if your goal is different dimensions or a different shape, use the resizer.

Using the measured file-size page

The “Measured results” section below this guide links to our JPG, PNG and WebP file-size comparison. For each format it shows the mean, median, minimum and maximum output size in bytes, then a table for every source file, and a short section on why a PNG can be larger.

The page states that its conditions do not represent equal visual quality across formats, that every source was a JPG, and that it does not establish a universal winner. Read the spread between the minimum and maximum as well as the mean, then repeat the comparison on your own picture with the three download buttons.

Measured results

Read the source data and test conditions behind these examples.

Related guides

Sources

← All guides