OpenStitching / stitching

A Python package for fast and robust Image Stitching
Apache License 2.0
2.07k stars 163 forks source link

Add support for passing parameters to imwrite() #225

Closed mstenta closed 2 months ago

mstenta commented 2 months ago

This adds a new CLI argument for passing parameters into OpenCV's imwrite() function.

This allows, among other things, to customize compression of the output image file. For example, currently a TIFF will always be output with LZW compression as a default. This allows exporting uncompressed TIFFs. JPEG quality can also be configured.

For the full list of imwrite() parameters, see: https://docs.opencv.org/4.10.0/d8/d6a/group__imgcodecs__flags.html

See related discussion for more detail: https://github.com/OpenStitching/stitching/discussions/224

Starting this as a "draft" pull request so that we can see if tests pass, and determine if anything else is necessary.

mstenta commented 2 months ago

Force-pushed my commit with the auto-fixes merged.

mstenta commented 2 months ago

Thanks for the feedback @lukasalexanderweber. I've made all the requested changes and force-pushed my commit. Hopefully the help text makes sense.

mstenta commented 2 months ago

lgtm, thanks for the updates and the detailed help string. Its a bit long but I don't know where else to put it xD

Great! Yea I had the same thought about the length of the help string. But it has the potential to be confusing, so it's probably worth a little more verbosity in this particular case. :-)

lukasalexanderweber commented 2 months ago

Thank you for your contribution and also very much for your donation over opencollective! :) it was the very first one and put a big smile on my face :)

mstenta commented 2 months ago

Thank you for making and maintaining this project! :-)