Ugly Hedgehog - Photography Forum
Home Active Topics Newest Pictures Search Login Register
Check out Commercial and Industrial Photography section of our forum.
Main Photography Discussion
How are Raw files processed into viewable image files?
Page <<first <prev 3 of 4 next>
Dec 17, 2018 09:12:08   #
Jimmy T Loc: Virginia
 
srt101fan wrote:
Thanks much Bill! As usual you are clear and to the point. Love to read your posts!



Reply
Dec 17, 2018 09:48:51   #
wapiti Loc: round rock, texas
 
RichardTaylor wrote:
See this wikopedia article to give you an idea of what is taking place.

https://en.wikipedia.org/wiki/Raw_image_format

As a end user I don't even think about what the software is doing (and I used to write software as part of my job).



Reply
Dec 17, 2018 10:14:21   #
steinr98
 
(with monochrome in-camera setting;) m You should be shooting your camera in full color!! Full color gives a larger file, which contains more information than Monochrome!! When you do th at actual converintin your choice of programs, you will get more tonality in your photos. I realize this is not a comment on your question, but did notice how you are shooting.

Reply
Check out Sports Photography section of our forum.
Dec 17, 2018 11:05:47   #
johntaylor333
 
srt101fan wrote:
First, my question is NOT about Raw vs JPEG! This has been discussed extensively, so please don't go there!

I'd like to better understand what happens when a camera saves Raw data and JPEG files and how the Raw data is converted to an image viewable on a computer screen. (I use a Nikon D5300 with monochrome in-camera setting; I save both Raw and JPEG; I use Affinity for editing (just started!); having said that, my questions really go beyond specific cameras, in-camera settings, and editing software.)

So,

1) I understand that the JPEG file produced by the camera, saved to the card, and visible on your camera screen is based on your in-camera menu settings (monochrome, contrast, brightness, etc, etc). I've read that there is also a JPEG embedded in the Raw file. Is this the same JPEG saved to the card and seen on the camera screen? If not, how is the Raw-embedded JPEG different and when and how is it used?

2) I understand that the Raw data cannot be viewed directly; it has to be processed to some extent. When you open a Raw file in a program like Affinity or LR you see the image, so it must have been processed to some extent. In Affinity this initial "Raw made viewable" image is apparently not based on the saved JPEG (my JPEGS are set to monochrome but the initial Raw image shown is in color!) What kind of processing has taken place to give you a viewable image in the editing program? Does it depend on the editing program?

3) Is it significant to know what processing has taken place in the creation of the initial viewable image from the Raw file? Or can you get to the same processing end point regardless of the starting point you work from?

I'd appreciate any constructive comments you might have....(I'll even take "don't worry about it, go out and shoot, and just push the PP sliders around")
First, my question is NOT about Raw vs JPEG! This... (show quote)


Further to my earlier question, I found this (very software oriented) detailed explanation of the Canon .CR2 format - http://lclevy.free.fr/cr2/

It appears that the RAW .CR2 file stores the image data is a JPEG lossless compression format, very similar to the TIFF format.

Reply
Dec 17, 2018 11:36:22   #
jeep_daddy Loc: Prescott AZ
 
What happens is that each and every pixel is represented by 14-bit code that could be 1 of 16 million different choices. Now, that is for each and every single pixel, and they are proprietary to the camera makers design. Multiply that times how ever many pixels across and down for the size of the sensor. Then use the manufacturers software code to decode and make the pixels appear as a photo on your computer screen. Then, companies like Adobe reverse engineer or sometimes get the proprietary code from the camera maker, and then incorporate that into their raw engine so that they can decode and represent the picture while you view it on your screen. The "codec" is the decoding factor for viewing the raw files on your computer screen.

srt101fan wrote:
First, my question is NOT about Raw vs JPEG! This has been discussed extensively, so please don't go there!

I'd like to better understand what happens when a camera saves Raw data and JPEG files and how the Raw data is converted to an image viewable on a computer screen. (I use a Nikon D5300 with monochrome in-camera setting; I save both Raw and JPEG; I use Affinity for editing (just started!); having said that, my questions really go beyond specific cameras, in-camera settings, and editing software.)

So,

1) I understand that the JPEG file produced by the camera, saved to the card, and visible on your camera screen is based on your in-camera menu settings (monochrome, contrast, brightness, etc, etc). I've read that there is also a JPEG embedded in the Raw file. Is this the same JPEG saved to the card and seen on the camera screen? If not, how is the Raw-embedded JPEG different and when and how is it used?

2) I understand that the Raw data cannot be viewed directly; it has to be processed to some extent. When you open a Raw file in a program like Affinity or LR you see the image, so it must have been processed to some extent. In Affinity this initial "Raw made viewable" image is apparently not based on the saved JPEG (my JPEGS are set to monochrome but the initial Raw image shown is in color!) What kind of processing has taken place to give you a viewable image in the editing program? Does it depend on the editing program?

3) Is it significant to know what processing has taken place in the creation of the initial viewable image from the Raw file? Or can you get to the same processing end point regardless of the starting point you work from?

I'd appreciate any constructive comments you might have....(I'll even take "don't worry about it, go out and shoot, and just push the PP sliders around")
First, my question is NOT about Raw vs JPEG! This... (show quote)

Reply
Dec 17, 2018 11:48:36   #
srt101fan
 
steinr98 wrote:
(with monochrome in-camera setting;) m You should be shooting your camera in full color!! Full color gives a larger file, which contains more information than Monochrome!! When you do th at actual converintin your choice of programs, you will get more tonality in your photos. I realize this is not a comment on your question, but did notice how you are shooting.


Thanks for commenting steinr98. I am saving Raw + JPEGs. So I always have the full Raw capability to process the image any way I want regardless of what my in-camera settings are.

I have the JPEGs temporarily set to monochrome because I want to see a preview of what the image would look like with that type of processing.

In my film days I was always more interested in B&W than color. My digital shooting has been all color. But I want to explore digital B&W and my monochrome JPEGs are part of my digital shooting and editing learning process. But my conversions to B&W will be done with the Raw files!

Reply
Dec 17, 2018 13:43:10   #
bwana Loc: Bergen, Alberta, Canada
 
srt101fan wrote:
First, my question is NOT about Raw vs JPEG! This has been discussed extensively, so please don't go there!

I'd like to better understand what happens when a camera saves Raw data and JPEG files and how the Raw data is converted to an image viewable on a computer screen. (I use a Nikon D5300 with monochrome in-camera setting; I save both Raw and JPEG; I use Affinity for editing (just started!); having said that, my questions really go beyond specific cameras, in-camera settings, and editing software.)

So,

1) I understand that the JPEG file produced by the camera, saved to the card, and visible on your camera screen is based on your in-camera menu settings (monochrome, contrast, brightness, etc, etc). I've read that there is also a JPEG embedded in the Raw file. Is this the same JPEG saved to the card and seen on the camera screen? If not, how is the Raw-embedded JPEG different and when and how is it used?

2) I understand that the Raw data cannot be viewed directly; it has to be processed to some extent. When you open a Raw file in a program like Affinity or LR you see the image, so it must have been processed to some extent. In Affinity this initial "Raw made viewable" image is apparently not based on the saved JPEG (my JPEGS are set to monochrome but the initial Raw image shown is in color!) What kind of processing has taken place to give you a viewable image in the editing program? Does it depend on the editing program?

3) Is it significant to know what processing has taken place in the creation of the initial viewable image from the Raw file? Or can you get to the same processing end point regardless of the starting point you work from?

I'd appreciate any constructive comments you might have....(I'll even take "don't worry about it, go out and shoot, and just push the PP sliders around")
First, my question is NOT about Raw vs JPEG! This... (show quote)

"How are Raw files processed into viewable image files?"

Depending upon the software, sometimes very poorly!

bwa

Reply
Check out The Dynamics of Photographic Lighting section of our forum.
Dec 17, 2018 14:33:51   #
IDguy Loc: Idaho
 
Your D5300 has a set of user adjustable Picture Controls. They adjust the RAW data by applying a number of image corrections when making jpeg images in your camera. Other settins such as white balance, ADL, and noise reduction can affect the jpeg image your camera makes,

The RAW files do not have those changes.



Reply
Dec 17, 2018 14:38:39   #
Bipod
 
srt101fan wrote:
First, my question is NOT about Raw vs JPEG! This has been discussed extensively, so please don't go there!

I'd like to better understand what happens when a camera saves Raw data and JPEG files and how the Raw data is converted to an image viewable on a computer screen. (I use a Nikon D5300 with monochrome in-camera setting; I save both Raw and JPEG; I use Affinity for editing (just started!); having said that, my questions really go beyond specific cameras, in-camera settings, and editing software.)

So,

1) I understand that the JPEG file produced by the camera, saved to the card, and visible on your camera screen is based on your in-camera menu settings (monochrome, contrast, brightness, etc, etc). I've read that there is also a JPEG embedded in the Raw file. Is this the same JPEG saved to the card and seen on the camera screen? If not, how is the Raw-embedded JPEG different and when and how is it used?

2) I understand that the Raw data cannot be viewed directly; it has to be processed to some extent. When you open a Raw file in a program like Affinity or LR you see the image, so it must have been processed to some extent. In Affinity this initial "Raw made viewable" image is apparently not based on the saved JPEG (my JPEGS are set to monochrome but the initial Raw image shown is in color!) What kind of processing has taken place to give you a viewable image in the editing program? Does it depend on the editing program?

3) Is it significant to know what processing has taken place in the creation of the initial viewable image from the Raw file? Or can you get to the same processing end point regardless of the starting point you work from?

I'd appreciate any constructive comments you might have....(I'll even take "don't worry about it, go out and shoot, and just push the PP sliders around")
First, my question is NOT about Raw vs JPEG! This... (show quote)

1. Geometry conversion (for each color plane): from a hexagonal field of pixels to a rectilinear array of pixels.
2. De-mosaicing: converting three separate RG&B color planes to RGB values for each pixel.
For a JPEG:
3. Optional lossy compression.
For any format:
4. Opening a disk file.
5. Writing the header to required by the format (TIFF, JPEG, whatever) to the disk file
6. Writing correctly-formatted data to the disk file
7. Closing the file (the OS updates the directory entry with the file size).

There are many different algorithms for geometry conversion and de-mosaicing, depending the
specific image sensor and on various trade-offs. Some sensors (e.g., those with a global shutter)
have the pixels spaced irregularly: there are gaps or rows where there are no pixels.

I somebody gave you three "honeycombs" -- corresponding to some shades of red, green and
blue -- and told you to make an image out of them, you can see that there might be a lot of
different ways you could do it.

First, you'd need to know a lot about the layout of the sensor, it's "microlenses", and the particular
color mask filter (or "Bayer filter") it uses. But then you'd have to decide which way produces the
best-looking image.

A diagonal line in the image will become a zig-zag line on the sensor honeycomb. This gets
converted to a stair-stepped line (at best) in the rectilinear array. The algortihm must try to
minimize these "digital artifacts". (In nature, diagonal lines really are diagonal! And in film,
a line is represented the same way regardless of its orientation.)

The sensor data includes not only image information, but also noise. The higher the ISO, the
more noise.

RGB color is basd on a color triangle -- but different sensors use different color triangles.
All this has to be converted to the RGB standard used by monitors. And all these color triangles
are different than the tringle used by the human eye.

Every color triangle can only reproduce the hues that lie within that particular triangle
on the color wheel. Hues outside the triangle cannot be reprodued.

Compression usually takes place "on the fly" -- as the data is being written to the disk file.
JPEG compression is "lossy" -- it loses information from the image (reducing resolution,
among other things).

We are used to lossless compression for text files--but nobody has been able to figure out a lossless
way to compress images that's efficient (produces significant reduction in size). Some formats
do use lossless compression, but it's not much better than "run length encoding".

The whole process is made much more complicated by the fact that there is no industry-standard
RAW mode format.

Never ask how sausage is made.

Reply
Dec 17, 2018 15:38:17   #
PierreD
 
The processing/demosaicing/whatever you decide to call it definitely differs between editing programs. I shoot with Olympus mirrorless and used to process RAW files using Topaz Studio.... great program, but processed files generally looked very dull. Could be something wrong I was doing, but I switched to DxO and it is a whole different world, with much better rendering (color fidelity, vibrancy) without much (in fact, less) file processing on my part. So, it pays to shop around and find what best fits what you are looking for.

Reply
Dec 17, 2018 15:48:56   #
CatMarley Loc: North Carolina
 
srt101fan wrote:
First, my question is NOT about Raw vs JPEG! This has been discussed extensively, so please don't go there!

I'd like to better understand what happens when a camera saves Raw data and JPEG files and how the Raw data is converted to an image viewable on a computer screen. (I use a Nikon D5300 with monochrome in-camera setting; I save both Raw and JPEG; I use Affinity for editing (just started!); having said that, my questions really go beyond specific cameras, in-camera settings, and editing software.)

So,

1) I understand that the JPEG file produced by the camera, saved to the card, and visible on your camera screen is based on your in-camera menu settings (monochrome, contrast, brightness, etc, etc). I've read that there is also a JPEG embedded in the Raw file. Is this the same JPEG saved to the card and seen on the camera screen? If not, how is the Raw-embedded JPEG different and when and how is it used?

2) I understand that the Raw data cannot be viewed directly; it has to be processed to some extent. When you open a Raw file in a program like Affinity or LR you see the image, so it must have been processed to some extent. In Affinity this initial "Raw made viewable" image is apparently not based on the saved JPEG (my JPEGS are set to monochrome but the initial Raw image shown is in color!) What kind of processing has taken place to give you a viewable image in the editing program? Does it depend on the editing program?

3) Is it significant to know what processing has taken place in the creation of the initial viewable image from the Raw file? Or can you get to the same processing end point regardless of the starting point you work from?

I'd appreciate any constructive comments you might have....(I'll even take "don't worry about it, go out and shoot, and just push the PP sliders around")
First, my question is NOT about Raw vs JPEG! This... (show quote)


The raw file is a bunch of data about your image. The processor takes your criteria and takes what it needs from the data file to assemble a JPG file which can be displayed on a screen according to a defined algorithm. The closest I can come to an analogy is the raw file is like my refrigerator. If I want to cook a meal, the meal I cook depends on what I take out of the fridge, and how I process it. There are many different meals I can make out of what's in the fridge. What I take out of the fridge limits how it can be processed as well.

Reply
Check out People Photography section of our forum.
Dec 17, 2018 15:49:43   #
srt101fan
 
rlv567 wrote:
The RAW files I use are from a Canon G16 and Canon 70D. My evaluations of a number of RAW processors have led me to believe that (for me) the best are Canon’s Digital Photo Professional – latest version – and Capture One. Canon’s program was free with my cameras; Capture One is quite expensive, at least for my very limited finances. As a consequence, I use DPP, sometimes just to get the conversion, but sometimes for all the processing required for a particular photo. When I need more, I use ON1 Photo RAW 2019. If a photo needs very little processing, I most likely will use Adobe Photoshop Express, which is free, and surprisingly capable – and extremely easy and quick to use.
I did use the Adobe subscription (Lightroom Classic CC and Photoshop) but have given that up. I may occasionally use one of the other programs I have had for some time, but very seldom, and only for a specific attribute. Those include Paint Shop Pro, DxO, Topaz, Photomatix, easyHDR and Franzis software, again, on a very limited basis.

I have found that while some programs are better overall than others, there is none which is best at everything, and even then it is dependent upon the photo being processed. Incidentally, one of my reasons for not using Lightroom is that I much prefer the file handling capabilities of ON1.

Loren – Baguio City
The RAW files I use are from a Canon G16 and Canon... (show quote)


Thanks Loren; at this point I'm committed to Affinity Photo for Raw processing and subsequent editing. I do also have the Nikon software. I've never used it but maybe I should, just to see how the Raw converters compare.

Reply
Dec 17, 2018 15:58:58   #
steinr98
 
Not a bad idea, as you then see the B&W if you are not sure of your capture-!!

Reply
Dec 17, 2018 16:33:06   #
srt101fan
 
f8lee wrote:
This is incorrect - it is not because "there is no standard" that raw files are all different, it is because every different chip produces a unique set of data - and that data stream is the raw file. A raw file (no capitalization needed) is not an image at all until it is "de-mosaiced", whereas JPEG (or TIF or PNG or other) file is actually an image file. Image files specify a particular RGB value for each picture element (pixel) in the array of pixels that make up an image, raw files do not. This makes sense once you understand how a digital sensor works.

Think of a digital image as a matrix of rows and columns, where an array of 6000 by 4000 would yield 24 million "dots" or pixels (picture elements). An image file consists of pixels that have clearly specified colors in terms of Red, Green and Blue values (RGB). So, for each pixel of an image file, there is a precise RGB value.

A raw file is the stream of data that comes from the sensor. With a few exceptions (Leica's monochrome, Foveon) ALL digital sensors, from that new Hasselblad to your smart phone camera, work as follows: while they too have a matrix of dots (called photo sites), each of those photo sites is covered with a colored filter that is either Red, Green or Blue. This is because the sensor chip itself is natively "color blind", each photo site can only register how many photons have struck it when exposed. The pattern of those colored filters (called the Bayer pattern) is R-G-G-B (for upper left, upper right,, lower left, lower right) - and there are twice as many green filters as there are red or blue because the human eye is more sensitive to green. Fuji's X-Trans chip uses a different pattern, but the concept is the same.

When an exposure is made, the data captured by the imaging chip is a bunch of values that represent how much light hit each photo site - and those measurements are all based on the light that made it through those filters. As a thought experiment, imagine a subject that was only pure blue - the photo sites with red and green filters above them would not register anything! Lots of black gaps in that file, eh?

So a raw file first needs to be rejiggered (to use the technical term!) to become a true image file, where each pixel has a stated RGB value. On the raw file, each spot has only an R OR a B OR a G value, but they are not blended. That process is called de-mosaicing, and the output of the process is the resultant image. Obviously there are a lot of calculations required to do this, but that's what the computer built into the camera (or phone) does. Cameras that only output JPEG do in fact create raw files to start with (there is no other option) but they quickly do the calculations and discard the raw file when the JPEG is created. And I believe the current iteration of iOS will allow for raw file storage on iPhones.

So, unlike a JPEG or TIF etc. file, the computer processing a raw file must interpret what actual color should appear at a given pixel, based on the readings made from the surrounding photo sites. There is no absolute lookup table, as there is for image file RGB values, to decide what color purple a given spot should be if one adjacent red reading was 500, another from the blue filter was 644 and yet another from a green filter spot was 42, or whatever.

For those who say "yeah but you need a computer to interpret" any digital file!” I say that is actually incorrect - where a JPG or TIF or PNG specifies that exact RGB value at each pixel (and leaves it to the hardware drivers and gear to not screw it up) the various demosaicing programs can actually result in different outputs from the same original raw file. Apple includes demosaicing software in OS X, but DxO, Phase One's Capture One, Adobe and others (including the camera manufacturers themselves) all have their own demosaicing software. While different software won't completely change the look of a given image, the subtle tonalities can well be different if you take an image and process it with C1 and compare that to the same raw file run through Adobe Lightroom.

By the bye, since you CANNOT see a raw image what you are looking at (on the back of the camera when you chimp, or on a computer screen) is a demosaiced image that has been interpreted by a computer, be it in the camera or on your desktop.
This is incorrect - it is not because "there ... (show quote)


Wow! I'll have to go back to school to understand all that! But seriously, thanks for the in-depth tutorial; I'll have to spend some time on it...

Reply
Dec 17, 2018 16:46:52   #
srt101fan
 
jeep_daddy wrote:
What happens is that each and every pixel is represented by 14-bit code that could be 1 of 16 million different choices. Now, that is for each and every single pixel, and they are proprietary to the camera makers design. Multiply that times how ever many pixels across and down for the size of the sensor. Then use the manufacturers software code to decode and make the pixels appear as a photo on your computer screen. Then, companies like Adobe reverse engineer or sometimes get the proprietary code from the camera maker, and then incorporate that into their raw engine so that they can decode and represent the picture while you view it on your screen. The "codec" is the decoding factor for viewing the raw files on your computer screen.
What happens is that each and every pixel is repre... (show quote)


Thanks jeep_daddy!

Reply
Page <<first <prev 3 of 4 next>
If you want to reply, then register here. Registration is free and your account is created instantly, so you can post right away.
Check out Sports Photography section of our forum.
Main Photography Discussion
UglyHedgehog.com - Forum
Copyright 2011-2024 Ugly Hedgehog, Inc.