Difference Between JPEG and RAW


JPEG and RAW are two popular digital photographic file formats. They differ in various ways, including image quality, file size, and post-processing flexibility. The JPEG file format is widely used for storing and exchanging digital photographs. RAW is a file type used in digital photography to store raw, unprocessed data from the camera's image sensor.

Read this article to find out more about JPEG and RAW and how they are different from each other.

What is JPEG?

The JPEG (Joint Photographic Experts Group) file format is widely used for storing and exchanging digital photographs. It is a lossy compression format, which means that some image data is removed to reduce file size. Here's a comprehensive overview of JPEG −

  • Compression Algorithm − The JPEG compression method aims to reduce the file size while maintaining image quality. It accomplishes this by taking advantage of the limited capabilities of human visual perception. The algorithm analyses the image and applies multiple approaches to efficiently compress the data.

  • Chroma Subsampling − Chroma subsampling is an important method in JPEG compression. It takes advantage of the fact that differences in brightness (luminance) are more sensitive to the human eye than changes in colour (chrominance). Colour information is compressed in JPEG by sampling the colour channels at a lower resolution than the luminance channel. This results in reduced file sizes while maintaining the perceived visual quality.

  • Discrete Cosine Transform (DCT) − To transfer image data from the spatial domain to the frequency domain, JPEG uses the discrete cosine transform. The image is represented as a set of frequency components in this transformation. The DCT divides the image into frequency bands, with low-frequency components indicating general image structure and high-frequency components showing tiny details.

  • Quantization − After the DCT, the frequency components are quantized. By dividing frequency values by a series of quantization tables, quantization reduces their precision. These tables decide the compression level and have a direct impact on the trade-off between file size and image quality. Higher levels of quantization produce reduced file sizes but generate more visible artefacts and detail loss.

  • Artifacts and Loss of Quality − Due to the irreversible nature of the compression process, JPEG compression generates artefacts and quality loss. Blockiness, blurring, colour shifts, and the appearance of compression artefacts around sharp edges and high-contrast areas are the most prevalent artefacts. These artefacts become more noticeable as compression settings increase.

What is RAW?

RAW is a file type used in digital photography to store raw, unprocessed data from the camera's image sensor. Unlike JPEG files, which are processed and compressed in-camera, RAW files maintain all of the information captured by the sensor, allowing photographers complete flexibility and control over the final image. Here's an additional explanation of RAW −

  • Unprocessed Sensor Data − RAW files include the camera's raw sensor data, which has not been processed in-camera. This consists of data about the intensity of light reaching each photosite (pixel) on the sensor, as well as colour and other metadata. RAW files function effectively as digital negatives, preserving all data for post-processing.

  • No Compression − RAW files are often uncompressed or losslessly compressed, which means they retain all of the original image data with no quality loss. When compared to compressed formats like JPEG, this results in larger file sizes. Because there is no compression, no image detail is lost throughout the capture process.

  • Greater Dynamic Range − RAW files have a wider dynamic range than JPEG files. The dynamic range of a sensor refers to the range of brightness levels that it can capture, from the darkest shadows to the brightest highlights. RAW files preserve the scene's whole dynamic range, allowing photographers to recover information from both the shadows and highlights during post-processing.

  • Color Depth − When compared to JPEG files, RAW files frequently have a richer color depth. The number of bits used to represent each color channel is referred to as "color depth. JPEG typically uses 8 bits per channel, allowing for 256 intensity levels per channel. RAW files can have higher bit depths, such as 12, 14, or 16 bits per channel, which provides a far broader range of colour information and more flexibility for post-processing modifications.

Difference between JPEG and RAW

The following table highlights the major differences between JPEG and RAW −

Characteristics

JPEG

RAW

Compression

Lossy

Uncompressed or lossless compression

Image Quality

Lossy compression, reduced image quality

Uncompressed, superior image quality

File Size

Small

Large

Post-Processing

Limited flexibility, in-camera processing

Extensive flexibility, raw sensor data

Workflow

Ready to use, minimal editing

Requires processing and editing software

Dynamic Range

Limited

Greater

Editing Flexibility

Limited

Extensive

Color Depth

8 bits per channel

Higher bit depths, more color information

Common Applications

Everyday photography, quick sharing

Professional photography, fine art

Noise and Artifacts

More noticeable

Less noticeable

Conclusion

In conclusion, JPEG files provide convenience due to their small file sizes and minimum modification requirements, making them suitable for quick sharing or printing. RAW files offer improved image quality and better post-processing flexibility and are commonly used by professional photographers who require complete control over the final output.

Updated on: 02-Aug-2023

78 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements