To add to the previous comments…
The compression used in JPEG, although lossy, will not result in any noticeable issues for most photographs of normal scenes in the real world, where there are lots of different colours used in every part of the image. The loss of information caused by the compression process shows up in “compression artefacts” in the image, but these will hardly be noticeable as long as a modest level of compression is used (this can be selected on the camera or when writing the JPEG) and as long as the process of re-compressing isn’t repeated multiple times.
For block graphics (e.g. logos) even modest levels of (lossy) compression result in artefacts that make the boundaries between blocks of colour messy. That makes PNG (with its lossless compression) a much better format for block graphics. Edit to add… PNG is also better for screen grabs, for the same reason (as long as the screen isn’t just showing a photo).
**PNG:** A PNG is what’s called a “lossless,” compression format. It looks for repeated data and simplifies it to save space. A simplified example would be: **RED, RED, RED, RED, BLUE** -> becomes -> **REDx4, BLUE**. The data you put in will always be the exact data that comes out but the file sizes will be larger than JPG/JPEG for reasons I list below, mainly because *exact* colors don’t tend to repeat too frequently outside of graphic design, meaning they can’t compress as much.
**JPG/JPEG:** First off, JPG & JPEG are interchangeable and the same thing. They’re what’s called a “lossy,” compression format. Basically they try to throw away data that you won’t notice in order to save space EX: All the pixels in the blue sky are *close* to the same color, so instead of remembering **light blue, slightly lighter blue, slightly darker blue, blue, light blue, etc.** it just remembers **blue** for all of them and then runs a similar process to a PNG to compress it down further. This means the data you put in won’t be the same you get out, so you have to be careful since if you save a JPG, then edit and save it again, you have just compressed it twice and will start to lose a LOT of quality.
If working in a production environment (video/photo editing, graphic design, etc.) it’s best to keep your files in a **lossless** format until the very end, or you risk the quality degrading with every step. If you’re final product is meant to be re-used (for example a logo or a video-intro meant to be re-edited into a larger work) *always* deliver the final product in a lossless format.
The biggest difference between the formats is the methods they use to compress images. Jpg & jpeg are actually both abbreviations for the same format, which uses lossy compression. Lossy compression is able to store the image with much less data, but loses some details & makes the image look noisier, but that usually isn’t noticeable unless the image was compressed with really low quality settings. Png uses lossless compression, which is able to still save a lot of space compared to raw image files, but can still be 5-10x larger than a jpg of the same image. Lossless compression, however, doesn’t cause any loss in image quality.
Png also allows a transparency channel, so any pixel can be partially or entirely transparent, where jpg doesn’t support this.
There’s also another mostly unused format, apng, which is essentially a gif with the same lossless compression & transparency as a png, which is a step up from gif’s 8-bit palettes.
One of the big differences between JPG and PNG is that PNG has the ability to use a transparent background.
One aspect of my job is creating photorealistic rendering of our products for catalog, website and print usage. I render everything out at a 1800 x 1200 PNG. This equates to a 6″ x 4″ image if being used in a magazine or catalog. I use PNG because they have the transparent background which means no weird box around the image.
JPEG and PNG are both compressed image formats, meaning they will build an image that compresses the size of the original image into less information than the original. The difference between the two is that PNG uses a lossless compression algorithm, meaning the new compressed image is the same as the original, only smartly packed into a smaller file, while JPG uses a compression algorithm that can destroy some of the information in the original picture. With PNGs, there is a limit to how much you can compress the image without causing losses, but with JPGs, image files can be arbitrarily small, depending on how much loss you are comfortable with, making it specially good for online transmission, especially in the early days of slow data transfer speeds.
Latest Answers