ome / bioformats

Bio-Formats is a Java library for reading and writing data in life sciences image file formats. It is developed by the Open Microscopy Environment. Bio-Formats is released under the GNU General Public License (GPL); commercial licenses are available from Glencoe Software.
https://www.openmicroscopy.org/bio-formats
GNU General Public License v2.0
370 stars 241 forks source link

Add `-quality` option to bfconvert #4171

Closed melissalinkert closed 2 months ago

melissalinkert commented 3 months ago

Fixes #3370.

Builds on work in https://github.com/ome/ome-codecs/pull/26 to pass a quality value (0.0 to 1.0) through to the JPEG codec. This can be tested by comparing conversions with different quality values, e.g.:

$ bfconvert -compression JPEG -quality 0.1 test.fake test_10percent.tiff
$ bfconvert -compression JPEG -quality 0.5 test.fake test_50percent.tiff
$ bfconvert -compression JPEG -quality 1.0 test.fake test_100percent.tiff

and different output formats (TIFF, OME-TIFF, DICOM). The output file size should increase as the quality increases.

Note that the JPEG writer does not currently make use of this, as it bypasses the JPEGCodec API.

Adding to 7.3.0 for now, but we can also push to 8.0.0 if this seems more suited to a major version.