working with raw image files

Dave Angel davea at ieee.org
Tue Jun 14 19:25:32 EDT 2011


On 01/-10/-28163 02:59 PM, kafooster wrote:
> On 14 Cze, 22:26, MRAB<pyt... at mrabarnett.plus.com>  wrote:
>>
>> Multiply the numpy array by a scaling factor, which is
>> float(max_8bit_value) / float(max_16bit_value).
>
> could you please explain it a little? I dont understand it. like
> multiplying each element?
>

You said in an earlier message to ignore the RAW format.  However, if 
your file matches a typical camera's raw file, there are several problems:

1) the data is typically 12 to 14 bits per pixel, only rarely 16 (very 
expensive cameras)
2) the data does not have R, G and B values for each pixel, but only one 
of these.  The others are generated by Bayer interpolation.
3) the data is linear (which is what the hardware produces), and 
traditional image data wants to be in some non-linear color space.  For 
example, most jpegs are sRGB 8*3 bits per pixel.

The first would mean that you'd need to do a lot of shifting and 
masking.  The second would mean a pretty complex interpolation 
algorithm.  And the third would require an exponential function at the 
very least.

DaveA



More information about the Python-list mailing list