View Full Version : Why does small RAW = huge TIFF/PNG/PSD/RAW?
pcasciola
16th of February 2005 (Wed), 10:42
Now that I am shooting a lot of RAW/aRGB, I'm at the point where I want to save a lot of my intermediate edits in a lossless, 16-bit format, and the files are 4-8 times the size of the original RAW. I've tried saving TIF w/ZIP, TIF w/LZW, PNG, PSD and Photoshop RAW. All of these files are typically 30-60MB a piece even with compression, yet the original RAW is only 8MB.
I'm justing wondering why, if RAW is really lossless, is it so much smaller than the same photo saved in these other formats? Is it that none of these formats support 16-bit aRGB natively, and the files are being saved as 16 bits per color plane, 48 bits per RGB pixel, which would make an 8MP image 48Mb of data to start with?
Longwatcher
16th of February 2005 (Wed), 12:07
Simple answer (I hope):
The camera has 25% red, 25% blue and 50% green filtered pixels, so if it is say a 8 MP camera it would have 2million red, 2 million blue and 4 million green pixels thus ignoring any compression it would have 8 million recorded pixels, which is what the RAW file would have. First there is some compression though (like lots when solid colors are present).
and most importantly...
When converting from RAW to say TIF, the conversion software turns those 2 million red pixels into 8 million pixels with red values and same for blue and green (4 to 8MP in this case) so the file size grows from 8 to 24 just from that process.
Now add in the lossless compression for the RAW image (typically expect a 2 to 4:1 compression) with the original raw file so if the raw file was compressed 2:1 then it would start at say 4Mb, but grow to 24Mb in TIF format. essentially a 6:1 increase in size.
Hope that explains it a bit.
kb244
16th of February 2005 (Wed), 12:15
Also keep in mind, the camera raws are generally 12bit, not true 16bit, so when saving to 16bit yer saving more information than nessary.
8-bit = 256 shades per channel
12-bit = 4,096 shades per channel
16-bit = 65,546 shades per channel
So when you look at it this way, the raw has 61,450 shades per channel, less than what the 16bit formats are saving. But still a good deal number of shades higher than 8bit can support. And because raws are unprocessed images, they simply save the color data from the sensors and such, its easier to compress a format that already knows how many actual colors it has in it's colorspace.
Raws are typically compressed as well, my digital rebel ( with the hack to make sure it only saves a small jpeg with the raw ), are typically 3 to 4 MB per raw file, depending on how much details are in the picture. Kinda like compressing by zip, or other archeival method that preserves all the data, but still compressing similarities, where as jpeg (which has few shades per channel, thus more possible similarities), blends near similarities, then compresses.
Jesper
16th of February 2005 (Wed), 12:23
Longwatcher explained it already, but by adding mine I hope I can make it even more clear...:
Your digital camera is actually colour blind! Each pixel on the sensor records only the intensity, and not the colour, of the light that falls on it. So how is it possible to make colour photos with a digital camera?
In front of the sensor is a filter that consists of a mosaic of red, green and blue coloured translucent tiles. Each pixel records only one of the three colours: red, green or blue, depending on the colour of the filter in front of that pixel. The filter is arranged in a Bayer pattern (http://en.wikipedia.org/wiki/Bayer_sensor).
In the RAW file, exactly the data that the sensor records is stored: 12 bits of only one colour for each pixel.
When you want to view a colour image on a computer, it must have all three components (R, G and B) instead of only one. When you convert the RAW image to a normal RGB image, the RAW conversion software computes the missing two colours for each pixel by interpolating the values of the surrounding pixels.
For example, for a green pixel, it computes the red and blue values by interpolating the red and blue values of the surrounding red and blue pixels.
This page demonstrates how it works: http://en.wikipedia.org/wiki/Bayer_filter
If you're converting it to a 16-bit TIFF, your original 12 bits per pixel RAW image becomes a 3 x 16 = 48 bits per pixel TIFF image. So that's already 48/12 = 4 times as much data as in the RAW image.
RAW images are also compressed with a ZIP-like algorithm by the camera.
pcasciola
16th of February 2005 (Wed), 13:15
Thanks for all the feedback. That definitely explains it. I had no idea the RAW conversion was that complicated. I thought the camera was still storing 8 million pixels with distinct level values for each color plane.
kb244
16th of February 2005 (Wed), 13:25
Raw is as the name implies, its a raw dump that the sensor captured. Which is why its so easy to recover loss in exposure or other issues when you shoot in raw rather than saving to jpeg from the camera.
Darkhorse
27th of February 2005 (Sun), 13:16
Is there any way to use RAW with an A70 with a hack or something?
CyberDyneSystems
27th of February 2005 (Sun), 13:48
Is there any way to use RAW with an A70 with a hack or something?
Nope,. the camera will only shoot in jpeg.
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.