Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

How to get BayerRG12 to .raw or .dng #151

Open
phil333 opened this issue Mar 4, 2023 · 3 comments
Open

How to get BayerRG12 to .raw or .dng #151

phil333 opened this issue Mar 4, 2023 · 3 comments

Comments

@phil333
Copy link

phil333 commented Mar 4, 2023

Hello,

I am trying to write bayer images into a raw image file so that i can edit them in a photo editor like lightroom or darktable. Can someone suggest a workflow or library to do this.

@Teresa-AlliedVision
Copy link

Hello,
I lost the code, but I had an example, where I debayered an image "by hand". In that case I converted the frame into a (probably NumPy) matrix and used the values like that to bring it into a format that I could display with openCV. Unfortunately I don't have any input on how to save the frame.

@phil333
Copy link
Author

phil333 commented Mar 14, 2023

opencv has a debayering function which works perfectly fine (cv2.COLOR_BayerRGGB2BGR). Saving the original data as numpy array would work too, but then i cannot open in a tool like lightroom or Rawtherapee. pidng is the closest to solving this problem, but somehow i can still not open these files it produces in rawtherapwee. And without some tools to edit the raw data, it is not really useful to keep the raw data.

@Teresa-AlliedVision
Copy link

Teresa-AlliedVision commented Mar 15, 2023

I also didn't find a useful library either, I'm afraid. I just previously found the conversion to numPy array useful to avoid implicit debayering when displaying the pictures, because there is no pixel format attached and I could manipulate it into the format I wanted. But with your application this doen't help a lot.
Unfortunately having the data as a pretty universal numpy array doesn't seem to make it easier to find a library to convert that into a .raw file. I'll update if I find something. RawPy seams to only read .raw files, not save them.
Edit: Is imagIO an option? It supports dng.
https://imageio.readthedocs.io/en/stable/formats/index.html

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants