avluis / Hentoid

Doujinshi Android App
https://discord.gg/QEZ3qk9
Apache License 2.0
1.01k stars 83 forks source link

[Feature Request] JXL support #1101

Open lordkitsuna opened 9 months ago

lordkitsuna commented 9 months ago

Hello i would like to request, support for the JXL image format. Almost no manga/doujinshi site i know of uses it directly however this would allow users to do it themselfs. JXL has the potential to save a substantial amount of space on large collections. even if the source files were jpg, JXL supports a lossless transition from JXL to the new format with a potential for up to 30% smaller file. and when talking about PNG the space savings can be massive.

as an example i converted a test library with just shy of 800 random works from nhentai and got the following results

Original Library Size: 14.5 GiB (15,546,233,934) JXL Library Size: 11.0 GiB (11,850,327,695)

This was with lossless JXL as in the mathematically lossless mode being used to ensure no quality loss in the conversion. thats normal for re-compressing jpg but i also used lossless for any PNG in the set as well meaning it could have realistically been smaller had i used something like -d 0.8 for a visually but not mathematically lossless. despite that i still saved 3.5GB which on a phone can be a nice chunk saved

RobbWatershed commented 9 months ago

Thanks for your suggestion 👍 I'll see what I can do.

RobbWatershed commented 4 weeks ago

Is your suggestion still relevant if we end up supporting jpegli (https://github.com/avluis/Hentoid/issues/1153)?

lordkitsuna commented 4 weeks ago

Support for both would be good but the main goal would be satisfied by jpegli as it uses many of the same heuristics as jxl to achieve similar compression gains

sadboy889 commented 1 week ago

jpegli have result similiar to webp in size compression, with more support and fast encoding

shame jxl is still being sleep on, you can save tons of space with it, with d1 (visually loseless) you can reduce size to 30-40% (for manga), 60% if the image is rich with colors, jxl is game changer for smartphone with limited storage