Is a 12mp JPG really 12mp?

NateNLogansDad

Still Wish'n
Joined
Jan 30, 2009
Messages
2,759
This might sound like a stupid question, but if you shoot in JPG, are you really using your camera to it's fullest capacity since JPG is a compressed format?

For example, if you wanted to use your kit lens for macro photography would you be better off shooting in RAW and cropping at 100% THAN converted over or would you get the same result if you started with a JPG?

(Assuming your WB, Exposure, etc were all perfect)
 
A 12 megapixel image starts out as 6 green megapixels, 3 blue megapixels, and 3 red megapixels. I'm ignoring Foveon sensors because, well, the marketplace essentially ignores them. Each of those pixels has 12 or 14 bits used to record its brightness. 12 bits gives you 4,096 different brightness levels. 14 bits gives you 16,384 different brightness levels.

When you camera converts that sensor data to a JPG, it converts each of the pixels into a full color pixel. It does this by adding values for the two colors that are missing (from the choices of red, green, and blue). It then takes those 12 or 14 bits per color channel and converts them into 8 bits per color channel. 8 bits gives you a range of 256 different brightness levels. So the jpg has 12 megapixels that have three color ranges each from 0 (black) to 256 (maximum brightness).

So what happens when you go from 4,096 to 256 colors? The range from darkest to brightest stays the same. You just have fewer steps along the way. So what you lose is very fine gradations in the colors. Will you notice it? No. Your display device and your printer are very likely to only handle 256 brightness levels per color anyway.

If you shoot RAW, you get to keep the extra bits. You really only use them when you post process. The result on your screen or printer is generally always from an 8 bit rendition of the file. Still, the extra bits can be useful during the processing steps.

In both circumstances, you are dealing with the same number of actual pixels. In both circumstances, the pixels start with only one color each and the camera or computer guesses at the other two colors.

Cameras usually have modes where you can, if you want, shoot in lower resolution for JPG and sometimes for RAW.
 
I forgot about compression. Both RAW and JPG files are usually compressed. Most RAW files are "losslessly" compressed and JPG files use "lossy" compression. The difference is that the lossless files decompress to exactly what they were before they were compressed. With the lossy compression, they throw away some pixels and just guess at what they were when they are decompressed.

JPG is a pretty good compression scheme. When used with low compression (the Fine/High Quality setting on a DSLR), you don't lose that much resolution. You do lose some, but it usually isn't very noticeable except for very fine detail. So I suppose you could say that a JPG file has less resolving power than a RAW file. It's resolution is still the same, but since more of the pixels are interpolated, you lose some resolving power. The difference should be very small.

Where JPG really starts to bite you is if you open, change, and save a file in JPG form. Every time you do that, it degrades the image. Even very low jpg compression looks terrible after a few round trips. If you shoot in JPG and intend to edit, always convert to a lossless intermediate format for your editing.

As a trivial aside, and this often confuses even knowledgeable computer people, most of the files in the universe of all possible files get larger with lossless compression, not smaller. It just happens that the files we work with happen to get smaller, so we find compression useful. If you created files with completely random information and tried to use lossless compression on them, they would usually get larger rather than smaller. Don't worry about it, though. It's a pretty useless bit of trivia.
 
This might sound like a stupid question, but if you shoot in JPG, are you really using your camera to it's fullest capacity since JPG is a compressed format?

For example, if you wanted to use your kit lens for macro photography would you be better off shooting in RAW and cropping at 100% THAN converted over or would you get the same result if you started with a JPG?

(Assuming your WB, Exposure, etc were all perfect)
MarkBarbieri's response is accurate but long.

The answer to your question is "yes." There is the same quantity of pixels in a raw format image as a JPG. If your exposure, white balance, etc. are perfect, then the JPG will be identical, except for nearly imperceptible artifacts.

The further you get from that ideal scenario, the bigger difference you'll see with raw.
 

you are always better off shooting raw, even if all things are perfect with your jpeg, your raw file would still still have more info to work with in post processing ,
 
MarkBarbieri's response is accurate but long.

The answer to your question is "yes." There is the same quantity of pixels in a raw format image as a JPG. If your exposure, white balance, etc. are perfect, then the JPG will be identical, except for nearly imperceptible artifacts.

The further you get from that ideal scenario, the bigger difference you'll see with raw.



Thanks for breaking it down so even I can understand it :happytv:

So, the "extra bits" you get with RAW have nothing to do with quality when zooming in, they are just information used to adjust the settings for when I screw up :confused3
 
MarkBarbieri's response is accurate but long.

I like Mark's answer because it's filled with details that help me to understand many of the factors that need to be considered when contemplating file size and type.

Thanks Mark!

:hug:
Marlton Mom
 
Thanks for breaking it down so even I can understand it :happytv:

So, the "extra bits" you get with RAW have nothing to do with quality when zooming in, they are just information used to adjust the settings for when I screw up :confused3

They can take more editing of the tone curve/contrast without getting posterization.
 
I like Mark's answer because it's filled with details that help me to understand many of the factors that need to be considered when contemplating file size and type.

Thanks Mark!

:hug:
Marlton Mom

Absolutely!:worship:

I hope I didn't come off ungrateful.
 
Thanks for breaking it down so even I can understand it :happytv:

So, the "extra bits" you get with RAW have nothing to do with quality when zooming in, they are just information used to adjust the settings for when I screw up :confused3

Ah, not exactly. The "extra bits" also contain some highlight data that JPG tosses out, in other words the dynamic range of RAW *is* larger than JPG. But you have to work to get it.
From a DPReview Canon 7D test:

"RAW headroom

Experience has told us that there is typically around 1 EV (one stop) of extra information available at the highlight end in RAW files and that a negative digital exposure compensation when converting such files can recover detail lost to over-exposure. As with previous reviews we settled on Adobe Camera RAW for conversion to retrieve the maximum dynamic range from our test shots.

As you can see the default Adobe Camera RAW conversion delivers less dynamic range than JPEG from the camera (a more contrasty tone curve). The best we could achieve was just under 10 stops (9.8 EV) of total dynamic range, more importantly just over a stop of that is in highlights. This is pretty much in line with other cameras in this class.
Settings Usable range
JPEG Default 8.3 EV
ACR Default 7.0 EV
ACR Auto 9.6 EV
ACR Manual 9.8 EV "



So, we see that if we use RAW with the default we are not exercising our cameras to the limit but if we take the care to adjust some settings then we are getting more dynamic range than we would with JPG. This is the main reason I use RAW, I like dynamic range! :)
 
Please don't get me wrong, I was impressed with the depth of Mark's response and learned a couple things myself (I always naïvely assumed that camera sensors were arrays of equal RGB triplets). If you're just aiming to find out the basics of "what can raw do for you?", it's a lot to absorb.

I love the extra data contained in the raw image. If you want to see what it looks like, you can download a free trial of Photomatix, which will take your raw image and use a special conversion algorithm that preserves the effect of the dynamic range. Takes much more manual tweaking than the default conversion, but can be very impressive.
 
Regarding your original question about whether 12 megapixels in JPEG is actually 12 megapixels, the answer is "yes".

To calculate the number of megapixels in a picture, simply multiply the number of pixels horizontally x number of pixels vertically.

Specifically, for your Nikon D5000, when you take a photo in Large JPEG mode, you'll end up with an image that is 4288 x 2848 pixels (width x height). Multiply these 2 numbers together, and you get 12,212,224 pixels = 12 megapixels.

*Regardless* of whether you shot in Large JPEG or shot in RAW, you should still end up with an image that is 4288 x 2848 pixels = 12 megapixels.


Why are JPEG files so much smaller than RAW files? Mark provided a very complete answer above. Here's something I wrote 2 months ago regarding RAW vs. JPEG. If you've already read it, go ahead and skip over the rest of my reply. :)


RAW is the original image data captured by your camera's sensor. If you shoot JPEG, your camera takes the original RAW data and throws away about 7/8 of that data to produce the final JPEG image. (I'm not sure about the exact fraction, but that's how it was explained to me by a professional photographer)

If you shoot JPEG, you're letting the camera's on-board computer decide how to convert the RAW file to JPEG. On the other hand, if you shoot RAW, *you* get to control how you want to process the RAW file to create your final JPEG image. In addition, your own home computer has tons more processing power than the little computer in your camera.

Warning: Nerdy math stuff ahead:

If you shoot JPEG, it's an 8-bit image. What does this mean? Each image is composed of different shades of red, green, and blue (hence, RGB). The term "8 bits" refers to 2^8 (2 to the 8th power) = 256. This means you get 256 shades of red, 256 shades of green, and 256 shades of blue. That sounds like a lot! And when you combine these different shades of colors, you can potentially create 16.8 million colors in an 8-bit JPEG file (here's the math: 256 red x 256 green x 256 blue = 16.8 million possible colors). That, too, sounds like a lot of colors!

If you shoot RAW, it's likely a 14-bit image. "14 bits" refers to 2^14 (2 to the 14th power) = 16,384. That's 16,384 shades of red; 16,384 shades of green; and 16,384 shades of blue! And combined together, you can potentially create 4.4 trillion colors (16,384 red x 16,384 green x 16,384 blue)!

(Actually, for the Nikon D5000, your RAW files are 12-bit files = 68.7 billion colors)

Why is this important? Any time you do any image processing on your computer, you'll end up changing the tones of the image. Because JPEG images have relatively fewer tones / colors, you may run the risk of "posterization", which are abrupt (often ugly) changes in tone. Here's an example of posterization in the sky:

2B89347333689797CE19A3E6178B6338C31C3936_large.jpg

If you shoot in RAW and you make adjustments to your images, you have much less risk of posterization since you've got so much data you're working with. As a result, your final images will have much smoother tonal gradations.

Whew!

Oh, a couple more things. If you decide to shoot in RAW, sometimes there's extra information hidden in parts of the image that appear "blown out". For example, if you took a picture of a forest and the sky appears way too bright (or, "blown out"), sometimes, you can actually "recover" some of the image from the blown-out areas, resulting in a more realistic-looking sky. You can sometimes do the same thing with dark shadow areas, too. However, if you shoot JPEG, you'll have less success recovering details from the bright highlights and shadows.

The other advantage of RAW is that white balance isn't "baked in" or processed as part of the image. Have you tried taking a photo indoors and found the picture to have a yellow tint? This is a white balance issue. If you shot in JPEG, it's much harder to correct the color because the white balance is already part of the JPEG image. If you shot the image in RAW, you can very easily change the white balance of the image to achieve the correct color for that image.


Why doesn't everyone just shoot RAW? There are some advantages to shooting JPEG:
  1. It's a standard format, so my JPEG image can be viewed on anyone's computer and can be printed on any printer.
  2. A JPEG file is lots smaller than a RAW file, so you can fit TONS more JPEG images on your memory card.
  3. If you're a sports photographer, you can shoot a HUGE burst of JPEG shots before the camera's buffer gets overwhelmed (whereas, if you shoot RAW, you can maybe shoot a dozen RAW photos before your camera freezes painfully for several seconds).
  4. If you don't care to do any processing of your images, then your JPEG images are ready to be used right away (ie. you can upload them immediately to your Flickr account, burn them onto a disk, e-mail them to family, post them on Disboards, etc).

If you do decide to shoot RAW, you'll need a special program that'll allow you to open the RAW files, process the RAW images, and then convert them to JPEGs. Your DSLR camera should have already come with a CD that provides a RAW processing program for free. For example, Canon provides its Digital Photo Professional (DPP) on a CD.

Other popular programs for processing RAW files include Apple's Aperture, Adobe Photoshop & Photoshop Elements (both of which include Adobe Camera Raw), and Adobe Lightroom. (there are many others, but these are probably the most popular)


Again, sorry for the long post.
 
MarkBarbieri's response is accurate but long.

The answer to your question is "yes."

:lmao::lmao::lmao:
I do have a tendency to be long winded. How about this for a shorter explanation:

You have just as many pixels, but they aren't as good. More of them are created by guessing and all of them are taken from a smaller selection of colors.
 


Disney Vacation Planning. Free. Done for You.
Our Authorized Disney Vacation Planners are here to provide personalized, expert advice, answer every question, and uncover the best discounts. Let Dreams Unlimited Travel take care of all the details, so you can sit back, relax, and enjoy a stress-free vacation.
Start Your Disney Vacation
Disney EarMarked Producer






DIS Facebook DIS youtube DIS Instagram DIS Pinterest DIS Tiktok DIS Twitter

Add as a preferred source on Google

Back
Top Bottom