JayXon / Leanify

lightweight lossless file minifier/optimizer
MIT License
831 stars 75 forks source link

Color of some pixels may be changed when alpha channel is 0 in PNG file. #68

Closed Leoongithub closed 2 years ago

Leoongithub commented 3 years ago

Although alpha channel is 0 means color is meaningless, is there an option to not change RGB channels' value?

JayXon commented 3 years ago

By default lossy_transparent option is enabled because there's no difference in the pixels we can see, it is possible to add an option to disable this, but I would like to know more about the use case, why do you need it to not change?

Leoongithub commented 3 years ago

I can use transparent area to record some hidden information. How do I use this option in CLI? Or I need modify the source code?

JayXon commented 3 years ago

Currently it's not exposed in CLI, but you can remove this line in the code

doterax commented 2 years ago

I have found the same behaviour. And in my opinion, by default, leanify should behave lossless. And only if user wants to squeeze more bytes, user should be able to add switch to enable lossy behavour in this case.

doterax commented 2 years ago

Hi @javiergutierrezchamorro, I have found that you updated leanify in https://sourceforge.net/p/nikkhokkho/code/1755/

So, please consider to handle additional parameter "--png-lossless-transparent" (Prohibit altering hidden colors of fully transparent pixels.) By default do not add anything, but user have to have ability to use it.