pedrocr / rawloader

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

Demosaicing Bits in example from README.md #41

Closed schmauder closed 2 years ago

schmauder commented 2 years ago

in the example of the README.md file i had to change line

let pixlow = (pix&0x0f) as u8;

into

let pixlow = (pix&0xff) as u8;

else i got dramatic posterization. i don't know whether this is a typo or has to do with the bit depth of my camera (14-Bit, arw format, Sony IlCE-7SM2).

pedrocr commented 2 years ago

Thanks! That was just wrong. It's even doing it in the low pixel and just throwing away the top 4 bits. By the way, if you're looking to do processing maybe imagepipe would be helpful:

https://github.com/pedrocr/imagepipe

Either to use as is or to just look up as inspiration on how to design a pipeline for your use case.