Replies: 1 comment 2 replies
-
|
I think I might know why. The only change since 4.9.2 in this file is the introduction of the quality parameter. For PNG we use Qt, which in turn uses libpng to save PNGs. PNG uses the zlib algorithm to do lossless compression. Zlib actually have 10 different compression levels. What is the point of that, you might ask when it is all lossless anyway. Well, it is a tradeoff between compression/decompression speed and compression ratio. There are still a few things that are strange about what you report.
Unfortunately Qt offers no documentation on this. Sources for more info; |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am using FAST's ImageExporter to export patches to, amongst other, .PNG. I have seen something that I found a bit strange, but might not be an issue at all. I am using a linux machine, and I have been using this python wheel for the most part. Then, extracting and saving patches, with the following code:
all my patches are of size 257KB on disk, which I think makes sense if they are RGBA images (256x256x4)/1024=256. However, I also made a few patches at a Windows machine due to another issue, and I have seen these are of different sizes on disk.
I therefore tested, on linux, to patch 5 patches with the the wheel at the top, which again gave patches of size 257KB, and again with the last stable FAST release (4.9.2), which gave patches of varying sizes on disk. To check the 5 patches with the different sizes, I converted one patch created with each wheel to numpy and did np.array_equal(im1, im2), which show they were the same. Thus the images seem to be identical. As I understand, PNG compress images losslessly, so no information should be lost even with the compressed patches. However, is there any reason that the wheel I have been using does not have any compression, while the stable 4.9.2 does, and should this make a difference in any way that I am not thinking of? Or do you think there is another reason to the size difference I have seen?
Thank you in advance :)
Beta Was this translation helpful? Give feedback.
All reactions