jcelaya / hdrmerge

HDR exposure merging
http://jcelaya.github.io/hdrmerge/
Other
354 stars 78 forks source link

Proposed tool: Convert images to dng format #198

Open abrock opened 4 years ago

abrock commented 4 years ago

I sometimes take images using industrial cameras which produce raw streams of pixel values. Previously I could convert them to tiff / png or similar but RawTherapee (my favorite RAW editor) wouldn't load them as raw files and I was stuck with bilinear interpolation for demosaicing. I managed to find other people's posts about that same problem but all the answers were disappointing ("Why would you even want to do that?", "Seems easy, just write a converter.") so I was very happy to find open source code which includes a DNG writer. I hacked a converter from any image format OpenCV can read to DNG.

My question is: Do you want to include such a tool into the hdrmerge package? I would be willing to polish it if neccessary.

fanckush commented 4 years ago

Sounds like a cool idea but i don't see how it's related to HDRMerge. I personally have no problem to include such too in the app but i'm just a fellow contributor

Maybe it would make more sense to integrate this into RT, i think you can reuse the DNGWriter class from HDRMerge because the licenses (as far as i know) are compatible

kmilos commented 3 years ago

There's already plenty of options to do the conversion to DNG:

http://a1ex.magiclantern.fm/bleeding-edge/pgm2dng.c (needs a few more files from CHDK) https://github.com/fastvideo/pgm2dng https://github.com/schoolpost/PyDNG

Storing a DNG is "easy" technically, but doing the calibration and getting all the color related tags right is the tough part.

Entropy512 commented 1 year ago

I agree with @kmilos here. If one of those three doesn't do the trick (for example you want floatingpointx2 compression, PyDNG does not support compression), I'm working on a reference/example Python script that uses tifffile to write out the DNG in preparation for some average-stacking work I want to do. I'll be putting it up in a repo later this week.