T
T
Torvald3d2017-11-19 04:22:05
C++ / C#
Torvald3d, 2017-11-19 04:22:05

What are the libraries for working with RAW images?

I am writing a graphics editor (C++, Qt), I want to add support for metadata and raw images. Requirements for the library:
- Read most RAW formats
- Be able to convert an image into a clear bitmap (floating-point is possible)
- Read metadata, incl. preview
- Save the modified image, its preview and original metadata in popular formats such as jpg, tiff, png, etc.
So far, I have only found libraw (cannot save), exiv2 (works only with metadata) and GraphicsMagick (it seems that it can do everything, but which one something monstrous).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mercury13, 2017-11-19
@Mercury13

1. RAW has several pieces: RAW CHDK, CRW Canon, NEF Nikon, platform-independent, but rarely used DNG ...
2. If you have a general-purpose graphics editor, I strongly advise against it. To “develop” RAW, you need special tools that are not available in a general-purpose editor. Plus a bunch of very smart things, like a debayerizer and noise reduction. Leave it to the lightrooms !
XnView, for example, looks, but it turns out to be rubbish - in CHDK RAW all these debayerizations and brightness curves are done randomly, and there is no noise reduction. Although the format is, admittedly, rare, Adobe takes it only through an intermediate platform-independent DNG.
In Nikon NEF, apparently, he looks at the preview: there is no difference with Medium JPEG - any developing program will show its character at least somewhere. However, there is one: hellish distortion inherent in compressed JPEG. In addition, I shot it in b/w, and it outputs it in b/w, in contrast to DxO, which must also be indicated that the format from the matrix must also be converted to b/w.
(I didn’t have any other cameras.)
But XnView is a viewer, it’s allowed, it must support as many formats as possible and show them, albeit at random.
Photoshop opens, but this toolkit is there in some form, and under the hood is something very smart, head and shoulders superior to the in-camera development of Canon soap dishes (Nikon did not check the DSLR). But they also collected all their RAW developments and made a separate program specifically for developing digital photos - Lightroom.
3. Back to RAW, in principle, is not worth it. This is a file from the camera's matrix, period. Are you trying to fake pictures?
UPD. Clearly, you decided to develop several frames in one HDR ...
Then the task of the library is to debayerize, perhaps suppress the noise, AND ALL. You need pictures in a LINEAR color space with 16 bits per channel. Normal development in JPEG (BMP, TIFF) DOES NOT ROLL, they have GAMMA-CORRECTED space by default and a unit near zero is not equal to a unit near 255. Let's put it this way: on the screen, in order to stand out against a black background, you need to lighten it by almost 60 units, on white - darken by 16. You will do the
rest of the magic yourself somehow. 1) Correct lens distortion (both geometric and color). 2) Merge three frames into one with fractional color space. 3) Think of how to bring all this miracle into a narrow range of the screen. 4) Adjust all these gamma corrections and other curves. 4) And only then convert to an integer [0…255].

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question