pedrocr / rawloader

rust library to extract the raw data and some metadata from digital camera images
GNU Lesser General Public License v2.1
304 stars 53 forks source link

Advice/Documentation for final brightness #40

Closed phip1611 closed 2 years ago

phip1611 commented 2 years ago

Maybe I'm missing something but I do not understand yet how I can determine the final/real brightness.

For example, if a camera only a bit-depth of 12 then 0x0fff is max brightness. If a camera uses 14 bit then 0x3ff is the max brightness of a pixel. How can I find out the final/real brightness with what's given right now by the library?

pedrocr commented 2 years ago

See the whitelevels and blacklevels fields. They give you the minimum and maximum values per channel. You can also use imagepipe to process the image for you or to just see the ops and their sequence to get inspiration on how to do your own processing:

https://github.com/pedrocr/imagepipe

phip1611 commented 2 years ago

Thanks @pedrocr ! Wow, parsing RAW files is more complicated than I initially expected

Where do you have all the background knowledge from for all the calculations you do? For example, gamma correction or color conversion? Did you use a C library, a book, or so?

pedrocr commented 2 years ago

This is all from experience from working on other raw pipelines and then several resources online. Bruce Lindbloom's website for example has a bunch of useful resources on color conversions:

http://www.brucelindbloom.com/index.html