How to Convert JPG to PNG, and What It Cannot Fix
A JPG converts to PNG in seconds and the result is an exact copy of the pixels in the JPG, with the same blur, blocks and missing transparency. That is useful in some situations and pointless in others, and the file will be larger either way.
By the Universal Image Converter Team
Convert in four steps
- Add your JPG files to the converter.
- Change the output format from JPEG to PNG.
- Check the size shown next to each file. A PNG made from a JPG is almost always bigger, sometimes by a factor of two or three.
- Download the files, individually or as a ZIP.
Nothing on the quality slider applies here, because PNG is lossless and there is nothing to trade away. The conversion cannot make the result worse than the JPG you started with, and cannot make it better.
Four situations where PNG is the right target
You will edit the picture several times. Saving a JPG again and again re-compresses it each time, and small errors accumulate. If you convert to PNG once and do your editing from the PNG, further saves cost nothing. The loss already in the JPG stays, but it stops growing from that point.
A program or form insists on PNG. Some design tools, game engines and upload forms accept only PNG. A converted file satisfies the check. The pixels are unchanged; only the container differs.
You want to add transparency later. PNG can carry it, JPG cannot. Converting does not make anything transparent. It gives you a format into which an editor can later cut out a background and save the cutout. The white box around a product photo remains a white box.
The image is a screenshot or graphic that was saved as JPG by mistake. Text and sharp edges in a JPG have fringes. Converting freezes them. If you can still get the original PNG, go back to it instead.
Why the PNG is so much larger
A JPG stores a close approximation of the picture in a compact form. A PNG stores every pixel exactly, using a general-purpose compressor that finds repeated patterns. When you convert, the decoder expands the JPG to raw pixels, and PNG then has to describe the JPG's approximation without loss, including all the faint compression noise, which compresses poorly.
I measured this on two synthetic 1920 x 1080 images encoded with Pillow: a screenshot-like page of text on white, and a noisy gradient. The screenshot as JPG at quality 90 was 295,077 bytes; as PNG it came to 559,354 bytes, 1.9 times larger. The noisy gradient as JPG at 90 was 876,842 bytes; as PNG, 2,839,856 bytes, 3.2 times larger. Browsers use their own PNG encoders, so exact counts will differ, and a real photograph sits somewhere between. The direction is the same every time.
The screenshot case has a clear cause. The original, never-JPG PNG of that screenshot was 213,652 bytes. Putting it through JPG first and then to PNG made it 2.6 times bigger than if you had kept it as PNG, because the PNG compressor now has to encode the JPG's noise around the letters. Details are in why a converted image can get bigger.
Reading the numbers as bytes per pixel
A quick way to judge a file is to divide its size by its pixel count. My 1920 x 1080 test pictures contain 2,073,600 pixels. The screenshot JPG at 295,077 bytes works out to 0.14 bytes per pixel, which is 1.1 bits per pixel. The noisy JPG at 876,842 bytes is 0.42 bytes, 3.4 bits per pixel. Their PNG versions came to 559,354 bytes (0.27 bytes per pixel) and 2,839,856 bytes (1.37 bytes per pixel). Uncompressed, every pixel would take 3 bytes, so those PNGs are 9 percent and 46 percent of raw size.
Do the same sum on your own file before converting. A JPG near the first figure is a smooth or heavily compressed picture, and one near the second is detailed or noisy. Either way the PNG will cost several times the bytes of the JPG, and if the JPG was compressed hard you will see blockiness that the PNG preserves faithfully.
What conversion does not do
- It does not sharpen or restore detail. Blocky areas, color fringes and softness stay exactly as they are. The idea that PNG is higher quality describes what it can store, not what you put into it.
- It does not enlarge the image. Pixel dimensions stay the same, and raster images are never scaled up by the converter. A 600 pixel wide JPG is a 600 pixel wide PNG.
- It does not carry over camera data. Capture time, location and camera settings are not written to the PNG. If you need them, keep the JPG; the metadata article has the details.
- It does not guarantee more compatibility. Almost every program that opens PNG also opens JPG. If your reason is compatibility, check the actual requirement first.
A worked editing scenario
Say you have a 2000 x 1500 JPG of a product that needs three rounds of retouching: remove dust, adjust brightness, add a caption strip. If you save as JPG after each round, the picture passes through three lossy compressions, and in each one the encoder re-approximates blocks that already contain approximation errors. Convert to PNG first and the three saves lose nothing further. The cost is file size during the work: at 3 megapixels, a 3 bytes per pixel raw image is 9,000,000 bytes, and the PNG will be a good part of that. When the work is done, export a single final JPG from the PNG. Total lossy passes: the one the camera or the original JPG made, plus one at the end, instead of four.
A quick decision for each file
Ask what the file will do next, then choose.
- Going to a website, email or chat: stay with JPG. The PNG will be bigger with no visible gain; see best formats for email and messaging.
- Going into an editor for multiple rounds of changes: convert to PNG once and work from it.
- Required by a form or tool: convert, but check the size limit, because the PNG may be over it where the JPG was not. If it is, reduce the maximum size.
- Needs a transparent background: converting alone will not do it; you need an editor to remove the background after converting.
Fitting the PNG under a size limit
When a form accepts PNG but caps the file size, the usual instinct is to lower the quality, but PNG has no quality setting. Two things work. Reduce the pixel dimensions with the maximum size menu; a 3000 x 2000 pixel picture contains 6 million pixels, and shrinking it to 1920 pixels on the long side leaves 1920 x 1280, about 2.46 million pixels, 41 percent of the original, and the PNG shrinks roughly in proportion. Or go back one step and see whether the form really needs PNG; many accept JPG when the label says "image". The converter shows the original and converted size for every file so you can test before you upload.
Switch the output to PNG, add your JPG files, and compare the before and after size before you download.
Open the image converter