Eli5 the difference between JPG, PNG, DNG, and TIF?


So I know the basics and enough to get by but I don’t really understand the whole (8bit/16bit/32bit depth) and I also don’t really understand ppi/dpi when it comes to the fact that my camera shoots at 240 ppi but I can upscale it to 300 ppi or higher with Photoshop would that make any difference in photo quality? Thanks!

In: 5

So 8/16/32 bit is the “size” of a pixel in storage. Bigger number means greater granularity in colors. Imagine an [analog color spectrum](https://www.google.com/search?q=color+spectrum&oq=color+spectrum&gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQABiABDIHCAIQABiABDIHCAMQABiABDIHCAQQABiABDIHCAUQABiABDIHCAYQABiABDIHCAcQABiABDIHCAgQABiABDIHCAkQABiABDIHCAoQABiABDIHCAsQABiABDIHCAwQABiABDIHCA0QABiABDIHCA4QABiABNIBCDI5NTZqMGo0qAIAsAIA&client=ms-android-oneplus-rvo3&sourceid=chrome-mobile&ie=UTF-8&chrome_dse_attribution=1#vhid=tpxjr34UUcr77M&vssid=l) across a rectangle. If you cut it in 8 segments and make each segment a single color (eg using the exact color at the midpoint of that segment) you can now represent every color in 3 bits. If you and one bit you get 16 segments, and twice as many possible color values and so on

For PPI, this is more about pixel density. More pixels per inch means less “loss” in the analog to digital conversion. Upscaling is using software to increase the pixel density (basically the computer spreads the captured pixels out and fills in the gaps). It can improve image quality but ymmv. It’s only really useful if you need to crop a segment

Most computer images are made up of an array of pixels (picture elements) – tiny dots of a specific colour. A computer screen is also made up of physical pixels.

Bit depth means how many bits (binary digits) can be used to store information about the colours. More bits means greater variety of colours, and hence better quality.

PPI is pixels per inch. The more pixels, the better the quality. Lower PPI images can look blocky or blurry.

DPI is dots per inch, it’s basically the same thing as PPI but for when the image is printed on paper. A monitor can have good PPI, a printer can have good DPI.

As a general rule, you can’t pull better quality out of thin air. Output is only as good as the source input. If your camera captures 240ppi images, but you upscale it to 300ppi in Photoshop, it’s because some combination of you the photographer and Photoshop (via its array of fancy in-built mathematics and algorithms and AI) are making educated guesses at what those additional 60 pixels per inch should be. It can potentially be done in a way that makes the image look better quality than it originally was. It could also end up looking horrible or unnatural. Either way, it’s a fiction, you’re inventing quality that didn’t exist in the source image. The more you do it to an image, the less real it becomes.

Most of the above concepts are not directly related to the question in the title, which is about file formats. JPG, PNG, TIFF and DNG are all different ways to store image data in a computer file. Some do store image data as pixels, but bit depth can usually be specified during encoding, and PPI is more a function of resolution and display/canvas size.

RAW is a family of file formats for storing raw image data captured from the camera’s sensors (eg. intensity of light). It’s a family and not a specific format because each camera manufacturer structures their RAW files differently.

DNG (Digital Negative) is a specific file format created by Adobe for storing RAW data from different manufacturers in a standard way. It is not compressed.

PNG (Portable Network Graphics) stores raster images (detail about each pixel). It uses lossless compression (no data is lost from compression). As with any raster format, some data may be lost in the conversion from RAW sensor data to raster pixel data (how much depends on the bit depth chosen).

JPEG/JPG (Joint Photographic Experts Group) stores raster images. It uses lossy compression (image data is lost because the format saves space by “generalising” data about groups of pixels, rather than every individual pixel).

TIFF (Tag Image File Format) stores raster images . It can be uncompressed, or use lossless compression or lossy compression.

Choosing which format to use is mostly a trade off between quality, size, compatibility. As well as other features like CMYK vs RGB colour spaces, transparency, multiple pages etc.