LUNAROPS · OPERATIONAL UPLINK 100% UPTIME 1,247d POSTS 893 JEFF.MOON@LUNAROPS.DEV UTC --:--:--

RAW vs JPEG

photographyrawjpegfile-formatseditingworkflow

When you press the shutter button on a digital camera, the sensor turns photons into an array of electron counts, and the camera then has to decide what to write to the storage card. RAW and JPEG are two completely different answers to that question. A RAW file is the digital equivalent of an undeveloped negative — the raw sensor data, plus enough metadata to reconstruct an image later. A JPEG is the digital equivalent of a finished print — the processed, compressed, ready-to-share output of the camera’s internal image processing pipeline. Same scene, same sensor, same instant, two files with very different structures, sizes, and capabilities. The difference matters enormously for how you can edit the file afterward, and matters almost not at all for how it looks straight out of the camera if the camera’s processing was good. The internet’s RAW-vs-JPEG argument has been running for twenty years and almost always frames the wrong question. The right question is not which format is better but which format matches your workflow, your patience for editing, the conditions you shoot in, and what you intend to do with the file. This post walks what each format actually contains at the bit level, the in-camera processing pipeline that turns sensor data into a JPEG, what RAW makes recoverable that JPEG does not, and the honest case for each format in the situations where each genuinely wins.


What a JPEG Actually Is

A JPEG (Joint Photographic Experts Group, named for the standardization committee) is the file format the rest of the world expects when you say “photo.” It is what gets emailed, posted, shared, printed at consumer kiosks, displayed on every phone and laptop. The format dates to 1992 and has been the default consumer image format for thirty years.

A JPEG file contains three things:

  1. 8-bit per channel RGB pixel values (sometimes 10-bit in extended profiles, rarely used). Each pixel is three bytes — one red, one green, one blue — quantized to 256 levels per channel.
  2. Lossy compression via discrete cosine transform (DCT). The image is divided into 8x8 pixel blocks, transformed to the frequency domain, the high-frequency coefficients are quantized aggressively (most information thrown away), and the result is entropy-coded. The result is small files at the cost of throwing away information you mostly cannot see.
  3. Metadata in EXIF format — camera make/model, exposure settings, GPS coordinates if enabled, color space tag (typically sRGB), and a thumbnail.

The “lossy” part deserves explanation. JPEG compression exploits the fact that the human visual system is much more sensitive to brightness changes than to color changes, and more sensitive to low-frequency information (large shapes) than to high-frequency information (fine textures). The compression discards information in proportion to its perceptual unimportance:

  • Color is converted from RGB to YCbCr (luminance plus two chroma channels) and the chroma channels are typically downsampled to half resolution (4:2:0 or 4:2:2 subsampling) before encoding. Half the color information is thrown away immediately.
  • Each 8x8 block undergoes DCT and the high-frequency coefficients are divided by a quantization table; many become zero. These zero coefficients compress trivially.
  • The remaining coefficients are encoded with Huffman or arithmetic coding.

The compression ratio depends on the quality setting — a “JPEG quality 95” file is much larger than a “quality 70” file and preserves much more high-frequency information. A typical 24-megapixel JPEG at high quality is 8-15 MB; at low quality, 2-4 MB. The same image as a RAW is 25-50 MB.

The honest tradeoff: a high-quality JPEG looks essentially perfect for normal viewing and printing. The compression artifacts (mosquito noise around edges, blocking in smooth gradients) are visible only on close inspection at large display sizes, and disappear entirely on web-sized images. The cost is irreversible loss of information that you cannot get back if you later want to edit aggressively.


What a RAW File Actually Contains

A RAW file (the term is generic; specific files are NEF for Nikon, CR3 for Canon, ARW for Sony, ORF for Olympus/OM System, DNG as the Adobe-standardized version) is fundamentally different. It contains the raw sensor data — the unprocessed, undemosaiced, full-bit-depth output of the camera sensor’s ADC, arranged as a single-channel grayscale array in the Bayer pattern, plus metadata describing what the camera would have done to process it into an image but actually did not.

The structure:

  • The sensor data array: one value per sensor photosite, 12 or 14 bits per value (some cameras 16-bit). The values are in the camera’s native Bayer pattern (R G G B repeating), not yet demosaiced into full-color RGB pixels. Compression is usually lossless or near-lossless; a typical 24-megapixel RAW is 25-35 MB compressed, 70 MB uncompressed.
  • The processing metadata: white balance setting, tone curve choice, picture style, color space tag, sharpening settings, noise reduction settings — everything the camera would have applied to make a JPEG. None of this is actually applied to the data; it is just recorded so that processing software can reproduce what the camera would have done.
  • The full EXIF metadata — same camera and lens metadata as the JPEG.
  • A processed JPEG thumbnail embedded inside the RAW file, used for camera playback and quick preview.

The crucial distinction: in a RAW file, “white balance” is metadata. It is a number the camera recorded telling the processing software “the user had the camera set to daylight white balance,” but the sensor data itself is the same regardless of white balance setting. You can change the white balance to tungsten at 3200K when you open the RAW, and the processing software treats the same sensor data as if it had been shot under tungsten, producing a completely different color rendition without any quality loss.

The same is true of:

  • Exposure adjustment: shift up to several stops without significant degradation. The 12-14 bit depth provides headroom that 8-bit JPEG does not.
  • Tone curve / picture style: completely changeable. Not baked in.
  • Sharpening and noise reduction: completely changeable.
  • Color space / color rendition: chosen at processing time.

What is not changeable: the actual exposure (you shot 1/125 sec at f/4 at ISO 800; those photons fell on the sensor at that moment), the focus point, the lens characteristics, the moment itself. RAW preserves maximum flexibility but cannot recover information the sensor never captured.

The 12-14 bit depth deserves emphasis. An 8-bit JPEG has 256 levels per channel, providing 256^3 ≈ 16.7 million possible colors. A 14-bit RAW has 16,384 levels per channel, providing 16,384^3 ≈ 4.4 trillion possible colors. Most of this extra precision is in shadows (the sensor is linear; small voltages get small numbers; the perceptually-encoded JPEG curve compresses this region heavily). The shadow region is where RAW most dramatically beats JPEG; shadows that look pure black in JPEG often contain recoverable detail in RAW.


The In-Camera JPEG Pipeline

The pipeline that turns RAW sensor data into a JPEG is what the camera does internally for every shot, and is what RAW processing software replicates when you open a RAW file. Understanding it makes the differences between the formats legible.

   IN-CAMERA JPEG PIPELINE

   sensor (Bayer-pattern data, 12-14 bit linear)
                │
                ▼
   black level subtraction (remove sensor dark offset)
                │
                ▼
   white balance (multiply R, G, B channels to neutralize the light source)
                │
                ▼
   demosaic (Bayer → full RGB; one of many algorithms)
                │
                ▼
   color space conversion (sensor RGB → working color space, often sRGB)
                │
                ▼
   tone mapping (linear → display gamma; usually a sRGB-style curve)
                │
                ▼
   picture style / contrast / saturation (artistic interpretation)
                │
                ▼
   sharpening (typically unsharp mask)
                │
                ▼
   noise reduction (varies by ISO; often more aggressive at high ISO)
                │
                ▼
   quantization to 8-bit
                │
                ▼
   JPEG encode (DCT, quantize, Huffman code, write file)
                │
                ▼
   8-bit JPEG file written to card

When you shoot RAW+JPEG (most cameras’ default for serious shooting), both files are saved: the RAW is the sensor data plus metadata, and the JPEG is the result of running this pipeline. Shoot RAW only and the camera skips the JPEG output (saving some processing time and storage). Shoot JPEG only and the RAW data is discarded after the pipeline runs.

When you process a RAW file in Lightroom, Capture One, DxO, RawTherapee, or darktable, the software re-runs essentially this pipeline. The key flexibility: every step of the pipeline can be changed. You can choose different white balance, different tone curve, different sharpening, different color rendering, different noise reduction — all at processing time rather than at shutter time. The RAW file has not been altered; you have just re-rendered it with different parameters.

This is the central operational advantage of RAW. The in-camera JPEG bakes in white balance, tone curve, contrast, saturation, sharpening, and noise reduction permanently. The RAW file lets you redo any of these decisions later with full bit depth and zero quality loss. If you got the white balance wrong, JPEG recovery is limited and ugly; RAW recovery is invisible.


Where RAW Wins

The specific situations where RAW’s flexibility translates into real-world capability JPEG cannot match:

Recovery from exposure mistakes. Underexposed by 2 stops? RAW lifts cleanly with shadow detail intact. JPEG produces noisy, posterized results. Overexposed by 1.5 stops? RAW often recovers highlights from one or two channels that weren’t fully clipped. JPEG cannot recover blown highlights at all because the values were quantized to 255 and the information is gone.

Mixed or wrong white balance. Shot the wedding reception under tungsten ballroom lights with the camera set to auto-WB that read the dance floor wrong? RAW is fixable trivially. JPEG fixes are limited and visible.

Heavy editing. Significant tone curves, dramatic color grading, region-by-region adjustments, dodge-and-burn work. RAW provides bit-depth headroom. JPEG starts at 8 bits and editing operations quantize further; after several rounds of adjustment you see banding in skies and shadows.

HDR work. Multiple exposures fused into a high-dynamic-range image benefit dramatically from RAW source files. JPEG inputs to HDR algorithms produce more artifacts.

Color-critical work. Product photography, fine art reproduction, anywhere the color must match a specific reference. RAW’s flexibility on white balance and color rendering is essential.

Future-proofing. Camera RAW processors improve over time. A RAW file from 2018 looks meaningfully better in 2026 Lightroom than it did in 2018 Lightroom because the demosaicing and noise reduction algorithms have improved. A JPEG looks the same in 2026 as it did in 2018 because the processing was baked in. If you might revisit images later, RAW gives you the chance to improve them.

Recoverable shadow noise reduction. Modern AI-based noise reduction (Topaz Photo AI, DxO PureRAW, Adobe Denoise) works much better on RAW than on JPEG. The algorithms need the linear sensor data to do their best work.


Where JPEG Wins

The cases where JPEG’s “downsides” do not matter and its upsides do:

Sports and action shooting at high frame rates. A pro camera can shoot RAW at 20 fps but the buffer fills in 1-2 seconds and the card write rate becomes the bottleneck. JPEG shoots indefinitely at the same rate because the files are smaller. For peak-action sports where you might shoot 50-shot bursts, JPEG is the practical answer.

Wire-service and event photojournalism. The deadline is the next hour, the editor wants files now, the lab on the other end is going to publish whatever you send. JPEG straight out of camera, tagged correctly, ready to upload. RAW would require processing time the workflow does not have.

High-volume amateur shooting. Family vacation, 2000 photos, going to be displayed at 1200 pixels wide on social media. JPEG hits 99% of the visible quality at a fraction of the storage and zero editing time. RAW is overkill for the use case.

Cameras with excellent JPEG engines. Fujifilm’s film simulation profiles produce JPEGs that many photographers (including pros) deliberately shoot to specifically because the in-camera color rendering is the look they want. Sony, Canon, and Nikon have also dramatically improved their JPEG output. Modern in-camera JPEGs at properly metered exposures look genuinely excellent.

Storage and workflow simplicity. RAW + JPEG doubles storage; RAW alone requires the discipline to process each shot before sharing. Many photographers shoot JPEG-only because the simplicity is worth more than the marginal flexibility on shots that don’t need fixing.

Cellphone use cases. Phones are increasingly shooting RAW (Apple ProRAW, Google Pixel raw, Samsung Expert RAW) but the computational photography pipeline that runs on the JPEG is often better than what a manual RAW processor can produce. The phone’s neural-network-based HDR, noise reduction, and segmentation are tuned specifically for the device’s sensor and produce results that are usually better than Lightroom-on-iPhone-RAW can match. RAW on phone is for the cases where you specifically need editing flexibility; JPEG (HEIC) is for the default cases.

Situation RAW JPEG
Wedding / event work where mistakes happen Strong Risky
Sports / action burst Limited (buffer) Excellent
Wire-service photojournalism Workflow too slow Standard
Landscape / fine art Almost mandatory Limits final image
Family / casual / travel Overkill mostly Fine
Phone photography Good when needed Default; often better
Studio / product / commercial Mandatory Risky
Long-term archive Better future-proofing Permanent quality
Shoot today, share now Workflow burden Ready immediately

RAW+JPEG: The Hybrid Most People Should Use

The setting most cameras default to for “serious” mode is RAW+JPEG: the camera saves both files for every shot. Storage is roughly 30-40 MB per shot total (RAW 25-35, JPEG 8-12), modern memory cards are large and cheap, and you get the benefits of both: the immediately-shareable JPEG for fast turnaround plus the RAW for any shot that needs editing.

The practical workflow:

  1. Shoot RAW+JPEG.
  2. Use the JPEGs for immediate sharing, social media posting, fast preview.
  3. For shots you keep or want to print/exhibit, process the RAW carefully.
  4. Archive both formats (RAW is the master; JPEG is the quick reference).

The main argument against RAW+JPEG is storage and card-write speed. On older cards or with very high megapixel cameras (45-100 MP), the camera buffer fills faster with RAW+JPEG than with RAW alone, slowing your burst shooting. On modern CFExpress cards in 2026, this is rarely the limiting factor for typical shooting.


DNG: The Vendor-Neutral RAW Format

A complication worth knowing: every camera vendor has its own RAW format with its own header, its own compression, and its own quirks. Nikon NEF, Canon CR3, Sony ARW, Fujifilm RAF, Olympus ORF, Panasonic RW2, Pentax PEF. Adobe’s response was the Digital Negative (DNG) format, an open specification standardizing the way RAW files are structured. DNG can be used directly by some cameras (Pentax, Leica, some Pixel phones), or you can convert proprietary RAW files to DNG using Adobe’s DNG Converter (free).

The arguments for converting to DNG:

  • Long-term support: a proprietary RAW format that the camera vendor stops supporting may become unreadable. DNG is an open spec.
  • Slightly smaller file sizes in some cases.
  • Embedded preview: DNG includes a higher-quality preview JPEG inside the file.
  • Single workflow: software that supports DNG handles all your files identically.

The arguments against:

  • Some metadata is lost: vendor-specific tags that some cameras embed in their RAW are not preserved in DNG.
  • Vendor processing software: Canon DPP, Nikon NX Studio, Sony Imaging Edge cannot open DNG. You lose access to the vendor’s color science and lens corrections in those tools.
  • The conversion itself: takes time, requires the original to be confirmed before deletion.

The practical answer in 2026 is “depends.” For long-term archive, DNG is sensible. For day-to-day workflow, the proprietary format usually works fine because Adobe and the other major processors support every major format directly.


What This Means for Workflow

A few practical implications for someone deciding what to shoot:

  • Default to RAW+JPEG for any work you might want to edit later. The marginal storage cost is small; the marginal flexibility is large.
  • JPEG-only is fine for casual / volume / time-pressured work, especially with modern cameras whose JPEG engines are excellent.
  • RAW-only is appropriate when you know you will process every shot (commercial / fine art / landscape) and want the maximum buffer for shooting.
  • Storage costs matter at scale. A wedding shoot in RAW+JPEG produces 50-100 GB; over a year of shooting, terabytes. Modern external SSDs (built on 3D NAND) are cheap, but the workflow needs to account for the archiving and backup.
  • Match the format to the color management workflow. RAW is editor-agnostic (the same RAW file can render to sRGB JPEG for web, AdobeRGB TIFF for print, ProPhoto RGB DNG for archive). JPEG is committed to its color space at shutter time; changing it later is a re-encode that loses quality.
  • The processing software matters. Adobe Lightroom Classic and Capture One are the professional standards; DxO PhotoLab and Topaz Photo AI excel at noise reduction; RawTherapee and darktable are powerful free options. The same RAW file can produce visually different results in different processors because the demosaicing and color science differ.

Verdict

RAW and JPEG are two answers to the same question — what should the camera write to the card — and the right choice depends entirely on what you intend to do with the file rather than on any abstract quality argument. JPEG is the finished product: 8-bit RGB pixels, lossy DCT compression, white balance and tone curve baked in, ready to share, much smaller files, what the rest of the world expects. RAW is the unfinished master: 12-14 bit Bayer sensor data, lossless or near-lossless compression, white balance and tone curve as metadata you can change at processing time, much larger files, requires post-processing before sharing. The flexibility RAW offers — exposure recovery, white balance correction, future-proofing as algorithms improve, heavy editing without bit-depth quantization — matters enormously when the shoot conditions are uncertain or the final use is demanding, and matters almost not at all when the camera nailed the exposure and color first time and the destination is social media at 1200 pixels wide. Modern in-camera JPEG engines from Fujifilm, Sony, Canon, Nikon, and the major phone vendors are excellent enough that many serious photographers deliberately shoot JPEG-only for specific use cases, and the computational photography pipelines on phones often produce better results than manual RAW processing of the same sensor data. The practical answer for most photographers is RAW+JPEG: save both, use the JPEG for the fast cases and the RAW when editing matters, and pay the modest storage cost. The wrong move is treating the choice as ideological — RAW is not virtuous and JPEG is not lazy; they are tools whose usefulness depends on what you are doing with them. Pick the format that fits your workflow, your editing intent, your storage budget, and the conditions you actually shoot in, and the file format stops being a debate and becomes a settled engineering choice.


Sources

Comments