I have some python code that outputs many large images that need to be in 16-bit format. I want them to be:
1) View-able using photo viewing software (eg. Xnview is ok but not ImageJ as its GUI is too tedious).
2) File size needs to be small.
Due to requirement 1), I'm considering outputting the images as jp2 or png. Currently I'm using using OpenCV to save these 16 bit images. However the files seem to be significantly larger than a 8 bit jpg of the same resolution. A file size comparison is as follows:
9827 x 7900 pixels RGB image:
- 8 bit jpg: 3.77mb
- 8 bit jp2: 92mb
- 16 bit png: 266mb
- 16 bit jp2: 308mb
I'm wondering whether it is possible to save compressed .jp2 files using Python? If not, are there any other ways of saving 16 bit images so that they are not too much larger than x2 the size of a jpg image? I can accept lossy compression and other programming languages.