Help me understand RAW

The RAW file contains the light value recorded by each and every photosite. JPG compresses by throwing away some of that information and replacing it with an average color.

For example, within a little 4x4 pixel patch of blue sky each pixel may register a slightly different shade of blue. The RAW file stores all of that data. When the jpg is created, looks at that 4x4 patch, determines that the eye probably won't discern all four colors and averages them to one or two unique shades of blue. So, while both the RAW and the JPG are using 4x4 pixels, only the RAW knows the original values of each pixel; the jpg changed them. Now multiply that across all the 4x4 swatches throughout the image an that's a lot of original data that is thrown out. To the human eye it looks the same, but the extra data is gone. When you process the JPG you're making adjustments based on the alterations that were made when the compressed JPG was created.

If the image was a grid of pixels, with letters on one axis and numbers on the other axis, (ala the battleship game), then the RAW file stores data as such:
Cell A1 = dark blue
Cell B1 = darker blue
Cell A2 = medium blue
Cell B2 = light blue

If you zoomed in so you could see the individual pixels that's what you'd see. However, when you zoom out those pixels blend together somewhat to the eye, and we see it just as a medium blue. So...jpg would describe the scene as:
Cells A1 & B2 = medium blue.
Cells A2 & B1 = dark blue

So, when you process the jpg it's only going to look at medium blue and dark blue when it interpolates new colors for that area. But when you process the RAW file it has all of the original colors that were in the image and, therefore, has more information to use for interpolation. This means you'll get smoother gradients.

As has been said over and over (and over) it won't matter for mild adjustments; jpgs have enough information for that. But when you get to a couple of stops over or under they start to break up. To replace that damage you need to do other stuff, which is essentially digital painting; you're no longer processing the original data.

As for what's beyond photo processing you misunderstand. I wasn't trying to say that it's wrong to do extra stuff to a photo. I wasn't arguing that heavily processing an image makes it no longer a photograph. I was pointing out that for the purpose of this discussion we're talking about how much original data is contained in the files and how much of it is available for processing, not what extra stuff that wasn't in the original file that can be added to it.
 
I see what you are saying on the editng. And editing was really my point to start with, not how the data is stored in the file.

When you're processing from RAW to jpeg you're not really loosing data there. It's as you said chainging the RGB values. The pixel and it's assigned value didn't go away, it just makes a larger field of one value and having more pixels with the same value makes it easier for the software to compress the file smaller. But you can change that color back in editing if you want to. Yes, it takes more work. But it's just a value... you can change it to whatever you want.

As I've said in I think every post... RAW is easier. But you can get there with a jpeg. In the end they're both just made up of dots of light. That's all additive color is.
 
We may just be arguing over semantics, but I'll push a couple of points anyway.

First, there really isn't anything that you can't do with editing. Someone with enough time and skill can start with a completely blank palette and color each pixel to create any image they want. They don't need a RAW file or a JPG. Because you can create any image with an editor, it is hard to specifically pin down things that you can't recover after a RAW to JPG conversion. That said, some things are much more practical with a RAW file than a JPG file.

There is definitely an "unrecoverable" loss of information when you convert from RAW to JPG. Like I said, a skilled artisan could recreate the information from their imagination, but it isn't there for someone with no knowledge of the original subject to recreate.

First, a RAW file stores pixels in one of three colors. Each pixel is green, red, or blue (assuming we aren't using a Foveon). When you convert the file to a JPG, it guesses at the two other colors for each pixel based on the pixels surrounding it. Once that guess is made, you can't go back. You've lost information.

Another difference is that each RAW pixel has more values. A typical RAW pixel represents a level of brightness for each color ranging from black to "white" in either 4,096 or 16,384 different brightness levels. A JPG stores only 256 brightness levels. Once you convert to JPG, you lose those extra steps. It is usually not an issue because most monitors, printers, and eyeballs can't really distinguish those finer gradations.

There is a similar issue in audio recording. Most devices I use allow me to record with 16 bits or 24 bits per sample. They both record the same range from silent to "max volume". The 24 bit recording just gives me more steps along the way. I can't hear any difference if I don't manipulate them. I record in 24 bits most of the time, though, because I can hear the difference if my recording level was too low and I have to really boost the volume.

Still another area where JPG irretrievably loses quality is with its compression. RAW files use "lossless" compression. When you uncompress the data, you get exactly the same values that you started with. JPG files use "lossy" compression. The compressor takes a guess at what information is important to you and throws away the rest. When you uncompress the file, it is not quite the same as when you compressed it. When you set the JPG quality setting, you are telling the compressor how aggressive it should be at throwing away information. This makes it very important that you not use JPG as your format for an image that you will repeatedly open, edit, and save. Each time you change the file and re-save it, more information will be lost.

So JPG differs from RAW in that it mixes the red, blue and green pixels to make multi-colored pixels losing the original distinctions. It has fewer steps in brightness, which can become an issue when manipulating an image. It also loses some information in its compression routines.

With all that bad stuff, why would anyone shoot JPG? First, those problems sound worse than they are. If you get a reasonably good white balance and a reasonably good exposure and you shoot in JPG Fine (meaning the compressor should be careful not to throw away too much information even though the file will be a bit larger), you won't notice a difference. You'll get much smaller files, so more will fit on your memory card and on your computer. You'll be able to take a more shots before your buffer fills up and your camera makes you wait. You'll also be able to display your shots without having to use a RAW converter.

I'm skeptical of people that get too religious about shooting RAW vs JPG. Both have their places. I like RAW because the advantages of JPG mean little to me. I rarely fill my buffer. I have large memory cards and tons of storage space on my computer. I use Lightroom to process all of my images and it is no easier to use with JPG files than RAW files.

That said, I could definitely see situations where I'd shoot JPG. Let's say that my son and his martial arts partner are putting on a performance together. They'll be on stage for just a couple of minutes and I want to get in the most shots possible. The lighting is even and consistent in color, so it is easy to get the correct exposure and white balance. The mom of my son's partner would really like a copy of the pictures and she has her laptop with her so that I can dump her a copy straight from my camera. In that case, I'm shooting JPG. I'll get more shots. I probably won't notice any difference in the shots. The JPG format is more convenient.
 

Look, the fact is, you cannot do with a jpg what you can do with a raw. You're not just talking about the same number of pixels - if so, the file sizes would be virtually identical. (Pretty much all raw files are compressed, so you can't go with that theory, either.)

There's a great demonstration here of dramatically pulling out a usable photo from what would be unrecoverable blackness in a jpg.

Even forgetting the extra headroom - let's not forget about white balance! Good luck fixing white balance properly once a photo has been converted to jpg. It'll never give the same flexibility as a raw file.

Even if you could get similar results from a jpg - if you're going to put the effort into post-processing, why would you? Why make it much harder on yourself? 8gb cards can easily be had for under $20. 2tb hard drives can be had for under $100. There's really no excuse not to shoot large. Shoot raw+jpeg if you must. If you want to be able to have jpgs ready to hand to people, many DSLRs now have in-camera raw-to-jpg converters.

I was reading the manual for my new camera the other day, and it does have a feature that would appeal to the die-hard jpg shooters - it keeps the last raw file in memory so if you are a jpg shooter and decide that you'll need to do some serious PP on your last shot, you can still get a raw from it on-demand. Kind of neat, though again I saw - just go ahead and shoot raw. :thumbsup2
 
I know this thread has been dormant for a while, but I thought I would add my 2¢. Hopefully, this offers a different perspective to some great replies.

So, as far as I understand, digital camera's do not really take pictures in color. In fact, all a digital camera does is record brightness levels. The result is a black and white image. Using a bit of trickery to get color, a camera actually takes 3 images every time you click the shutter. Each of these image has has a filter to only record the brightness of one color (red, green and blue). By combining those three images you get full color.

In fact, in photoshop (and possibly other imaging apps) you can view this by looking at the channels of an image.

Now even though the camera has taken three grayscale images, most people don't want that, they want the color version. So your camera takes the three images and combines them into one color image. After it does this, it throws away the grayscale ones. This merged color image is then saved in the jpeg format. By doing so not only is the grayscale info discarded, but the jpeg is compressed.

If a camera supports raw, then instead of throwing away all the information of the grayscale files, it puts them in an uncompressed container file. While the container file has a much bigger file size, you have a file that has a lot of flexibility. By opening it up in a program that edits raw files, you can tweak the image and then export out a better quality image the the jpeg the camera would have saved. This exported image is commonly referred to as a processed file, which is why people often refer to raw images as a digital negative. The theory of digital negative makes a lot more sense for people who have done there own darkroom work and know that a negative can be printed many different ways.

One of the biggest differences of jpeg vs raw, is if you alter a raw file, you can always revert it back to its default state. Where as, if you make changes directly to the jpeg, you are altering the file and the changes are perminate (assuming you don't use layers). You can also can do SOME upscaling of raw files, without degradation of quality - something not possible with jpegs.

Obviously, this is not meant to explain all of the complexities of raw, but to be an insight.

Really the true question is what should you shoot. In my opinion, there is only ONE downside of raw. That being that it uses a lot more files space. For example, an image shot in jpeg might be 2MB where as if it is shot in raw it will be 15MB or higher.

On the plus side, every camera that shoots raw comes with software to convert raw images to jpegs. Also most, if not all, raw shooting cameras will allow you to shoot raw+jpeg. Which means that it will save on your card a raw and a jpeg version of every image you shoot. So if you want the connivence of jpeg, or are not ready to work with raw, shooting raw+jpeg allows you to get the best of both options.

Long term, the benefits of raw are gaining a much larger set of options in the future of how to work with your images.
 
mmcxiiad, fundamentally, you're understanding is correct, but some of the details are inaccurate. It doesn't really matter, though.

You're correct that each photosite on the sensor is actually measuring how much light is reaching it through either a red, green, or blue filter. It's not taking three different exposures, it's just taking one. Software takes the raw data, and knowing the basic pattern that the red, green, and blue filters are in (Bayer), it can determine the brightness levels for each of those colors for the photosites. It's like a color-by-numbers. It then interpolates that information to come up with averaged colors (why you don't see just individual red, green, or blue pixels when you zoom in to the pixel level).

Foveon sensors actually capture the red, blue, and green levels for each photosite. Because there are fewer actual photosite on such a sensor, they multiply the actual megapixel count by 3 when they advertise. So, even though it's a 6 megapixel sensor they'll call it an 18 megapixel sensor.

The bottom line is that RAW contains the original, unaltered data form the image capture. Jpg data has been altered, so there's a limit to how much you can recover. Nine times out of ten, though, jpg is good enough.

Y'know, right after this thread ended months ago I came across a badly underexposed image that happened when my finger accidentally hit the shutter release button prematurely. Just for kicks I edited the straight out of camera jpg and the RAW file to see how much I could recover from each. The difference was dramatic. I considered posting the set of images here to prove the point, but I never got around to it. If I haven't deleted it already, I'll try to post them when I get home later.
 
mmcxiiad, fundamentally, you're understanding is correct, but some of the details are inaccurate. It doesn't really matter, though.

You're correct that each photosite on the sensor is actually measuring how much light is reaching it through either a red, green, or blue filter. It's not taking three different exposures, it's just taking one. Software takes the raw data, and knowing the basic pattern that the red, green, and blue filters are in (Bayer), it can determine the brightness levels for each of those colors for the photosites. It's like a color-by-numbers. It then interpolates that information to come up with averaged colors (why you don't see just individual red, green, or blue pixels when you zoom in to the pixel level).

Foveon sensors actually capture the red, blue, and green levels for each photosite. Because there are fewer actual photosite on such a sensor, they multiply the actual megapixel count by 3 when they advertise. So, even though it's a 6 megapixel sensor they'll call it an 18 megapixel sensor.

The bottom line is that RAW contains the original, unaltered data form the image capture. Jpg data has been altered, so there's a limit to how much you can recover. Nine times out of ten, though, jpg is good enough.

Thanks for the additional info. While I didn't write it before, I do realize that there is only one real image. It just seemed to be an easier way to describe it as three. The truth is closer to a digital camera doesn't really take images, it exports the data that it captures and creates an image. Of course the how this all really works is fundamentally out out my comprehension level.

I think that (speaking collectively) we equate too much about digital photography using film as a reference point. And while there are a lot of similarities, there are a lot of differences too. For most people, the differences and their complexities are largely irrelevant. Where the differences become an issue is when you try to use familiar terms to explain an abstract principle. Well, at least that is the way I look at it.

Yes it is true that for most people, shooting jpeg is sufficient. Especially if the photo editing involves minor editing. And while the jpeg spec has gotten much better to produce better quality images, personally, I wish cameras would drop jpeg all together and move to tiff with zip compression. But since tiff is an Adobe created file type, that isn't going to happen. Because who wants to pay adobe to license it in every camera?

On a totally somewhat related note- I think that it is coming time to begin teaching kids (at least in middle school) that the primary colors are not always only red, yellow and blue. Try having that conversation with people. I tried to explain to someone I know that when it comes to light, print and paint - there are completely different primary colors. I think I would have had more luck trying to explain to her that she was living in the matrix.
 

New Posts


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