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

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

Open

Description

@phil333

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.

Activity

  1. Teresa-AlliedVision commented on Mar 14, 2023

    @Teresa-AlliedVision

    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.

  2. phil333 commented on Mar 14, 2023

    @phil333
    Author

    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.

  3. Teresa-AlliedVision commented on Mar 15, 2023

    @Teresa-AlliedVision

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions