MorganGrundy / MosaicMagnifique

Application for generating Photomosaics. Turn your images into beautiful Photomosaics.
https://morgangrundy.github.io
GNU General Public License v3.0
15 stars 0 forks source link

[REQUEST] Encode the Mosaic Image Library files #26

Closed MorganGrundy closed 2 years ago

MorganGrundy commented 2 years ago

I just realised that we are writing the full image data to MIL files. Instead we should encode the images first to reduce the file size.

MorganGrundy commented 2 years ago

I'm experimenting with using OpenCV's imencode and imdecode to encode the images as png (lossless) before writing to the MIL file. Just from my initial test I'm honestly suprised by the reduction in file size. Obviously it will vary based on the images but for lib.mil it is reduced by nearly 40%.

MorganGrundy commented 2 years ago

Both lib.mil (f188581) and big-lib.mil (fec5fab) reduced in file size by about 40%.

MorganGrundy commented 2 years ago

I just tried adding level 9 png compression, the file size reduction was minimal and had a significant performance cost. So not at all worth it.