Originally posted by illwieckz
View Post
The format and the png library is well defined and tested in all its options.
If some application does not support writing 1 bit images, or 8 bits and alpha channel, it is a problem of the application. Or maybe not, as each application has a purpose and developers may choose to ignore some variants on saving. It is easy to upscale everything to RGBA during loading, but on saving, it is questionable if the application should do image depth conversion, if such depth is not natively supported within the application.
In a typical graphics application, program internally supports a couple of different image formats (for example: 8 bit colormap, 8 bit greyscale, 24 bit RGB, 32 bit RGBA ... ). Some functionality is available for certain image depths, other are not. Some applications may choose to only support RGBA, to simplify the code.
Then the program outputs the image in various formats like PNG, TIFF, GIF, JPEG, WebP... each with its own color space and depth limitations. Supporting every option in every format is usually not feasible, we support typical use cases, which benefit users and fit the application internal image model.
In my software, I have the option to post-process the saved PNG with optipng after saving. So users can have reasonably fast saving, and small archived files.
I also use zlib for compression of undo steps. Here, top level compression is not necessary, we need reasonable compression and fast response time. File size is not the most important thing, as undo steps are deleted on exit.
So we must view the compression in context of application usage.
Comment