-
-
Notifications
You must be signed in to change notification settings - Fork 340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New feature: DNG raw image support for arv-viewer + 16 bit Bayer grayscale preview #790
base: main
Are you sure you want to change the base?
Conversation
It is 8 byte long according to wireshark u3v dissector. Fixes AravisProject#578
Hi @victhor393 Thanks for your work on this. This would be a neat addition. Some comments / question:
|
Hi @EmmanuelP, Thank you for your comments. Regarding the choice of DNG over TIFF, it was made because TIFF does not really support images with Bayer format. There was an extension added to the TIFF standard called TIFF/EP that adds support for such images, but it was never widely adopted, according to a brief research. DNG is an attempt to extend upon the TIFF/EP work which has been widely accepted. Since the specification is public, it has been implemented by various image editors and viewers, including open source software such as RawTherapee and Darktable, which makes it a good choice for Bayer-formatted images, especially since other raw formats are proprietary. It's also flexible enough to support non-standard color filter arrays, like sparse CFAs and array geometries other than 2x2, if required in the future, though no existing software supports processing such unusual images, to my knowledge. Additionally, DNG supports "linear" (demosaiced) images, so it can be used for grayscale and RGB images as well. However, in my view, it offers no advantage over a standard TIFF in this situation, so it would be good to implement TIFF support for non-Bayer images. While one could always convert the unformatted raw into a DNG after capture (which is what I'm used to doing), this approach offers a significant increase in convenience over the alternative of running a separate conversion program, taking notes of camera parameters and writing these to the DNG file using I will try to implement these other features you suggested and update the PR as they're completed. |
Is it acceptable to use |
I would prefer a new |
I updated my PR with an implementation of |
Hi @victhor393 Sorry for the late review. I have tried your patch. When I'm trying to open the file in darktable, I'm only getting a black image. It is probably related to these GStreamer warnings:
The compilation also emits warnings:
|
Thanks for testing it, I haven't been able to keep up with this patch, as I had a lot of work to do for the last month or so. I'll try to work on it as soon as I have some time available. |
Sorry, it took much longer than I hoped for me to have the time to work on this again! |
This PR adds support for saving raw images as DNG, and also enables Bayer 16 bit format support on arv-viewer.
Since Gstreamer still doesn't support Bayer formats with more than 8 bits, this PR adds a hack that treats Bayer 16 bit formats as grayscale. This mainly makes it possible for arv-viewer to save 16 bit images, while the preview window can be used to eyeball exposure settings and adjust composition.
DNG support is very much what I'd consider a work in progress. Right now, it's able to write Bayer 8 bit and 16 bit formats (tested with both the fake camera and a real camera with Bayer16 support), with no metadata, appropriate color correction matrices, profiles or white balance ("As Shot Neutral").
It uses libtiff to generate a valid DNG file (as far as Rawtherapee and Adobe's own DNG converter are concerned), instead of the Adobe DNG SDK, since getting the latter to compile under Linux seems rather difficult.
This PR has a number of issues: no Exif metadata is written with the DNG file, thumbnail isn't written to the file by libtiff, there's no error handling for the DNG writer function, and overall I'm not very confident in the quality of its code.
That being said, it does show potential usefulness:
I'm sending this PR in hopes that I can gather some useful comments regarding this new feature and how it can be further developed, so that it can be merged into Aravis eventually if so desired.