Replies: 10 comments 8 replies
-
The short answer is that the output image name is directly passed into OpenCVs |
Beta Was this translation helpful? Give feedback.
-
Related but separate question (perhaps deserving of it's own discussion): I noticed that 16-bit TIFFs always end up as 8-bit TIFFs in the result. Would it be possible to support 16-bit TIFF output? A little more background, to explain why I'm interested in these things: I am experimenting with digitizing large format (4x4 inch) film negatives using a DSLR camera over a light table, with the end goal of producing very large uncompressed TIFF files that can be professionally printed 30x30 inches or larger. I take multiple RAW photographs of the negative in a grid pattern, then use Darktable to invert, color correct, etc, and export 16-bit TIFF images. My hope is to stitch these TIFFs together into a final high-quality file that can be used as the "final" image, which can be used to produce derivatives for print/web/etc. |
Beta Was this translation helpful? Give feedback.
-
I see. So this is an upstream limitation of OpenCV's Thank you for the quick answer! |
Beta Was this translation helpful? Give feedback.
-
Researching From https://docs.opencv.org/4.x/d4/da8/group__imgcodecs.html (only including TIFF bullet point):
There is also mention of customizing compression in an example:
Perhaps |
Beta Was this translation helpful? Give feedback.
-
Documenting more research links...
Also, according to this SO answer:
However, it looks like |
Beta Was this translation helpful? Give feedback.
-
(I updated the discussion title to make this specific to "16-bit uncompressed TIFF output". But if a feature is added ideally it would support more options as well.) |
Beta Was this translation helpful? Give feedback.
-
From chatgpt:
|
Beta Was this translation helpful? Give feedback.
-
Based on this, I wonder if the 16-bit to 8-bit conversion is actually happening in I tested it by changing line 113 of
Perhaps 16-bit breaks the stitching logic in other places? 🤔 |
Beta Was this translation helpful? Give feedback.
-
Setting aside the 16-bit question... I tested disabling TIFF compression by changing line 313 of Result: it worked!
And the output filesize is now 65.7 MB (instead of 26.4 MB with default LZW compression). |
Beta Was this translation helpful? Give feedback.
-
@lukasalexanderweber I have created an main...mstenta:stitching:imwrite_params I tested disabling TIFF compression with this locally and it worked. The command looks like this:
I would be happy to open a pull request, but I have not run the tests, nor added any new tests for this. Would it help to open a "draft" PR as a first step at least? I defer to you on your preference as maintainer. :-) |
Beta Was this translation helpful? Give feedback.
-
Thank you for this library! It works like magic and I'm so grateful for the work you've done. :-)
I have one question: is it possible to configure or disable compression in the final result image file?
I am experimenting with using this library to stitch together four high quality uncompressed TIFF image files.
Each is 2602x3908 pixels and 30.6 megabytes. There is a lot of overlap between them, with a combined result size of 4729x4628 pixels. Nevertheless, the combined TIFF file size is only 26.4 megabytes. When I look at the EXIF data I see that LZW compression is applied.
For JPEGs there seems to be a much larger loss of information. The same four images in JPEG format are 10.1 megabytes each, but the combined result JPEG is 4.7 megabytes.
Are there any options for configuring or disabling this so that the resulting image is uncompressed? I don't see anything in the
-h
help options, but maybe I'm missing it.If not, would this be a good candidate for a feature request?
Beta Was this translation helpful? Give feedback.
All reactions