aicodix / shredpix

Send images over COFDMTV encoded audio
BSD Zero Clause License
3 stars 2 forks source link

"JPEG XL" image format support? #5

Closed ropucyka closed 6 months ago

ropucyka commented 7 months ago

It have much more image quality at same file size compared to lossy WebP or JPEG.

Assempix will require simple viewer in this case. Or, image with higher quality can be send with conversion: Shredpix ( image -> jxl ) --> sending JPEG XL image --> Assempix ( jxl -> png ), then no any viewer needed.

5380 bytes... this current algorithm cannot send signal as many long time as needed?

xdsopl commented 7 months ago

I did some experimenting with my own discrete wavelet transform (DWT) based image compression coders and wanted to support that but ultimately decided against it, because of the simple reason you just mentioned: We need support outside of Assempix and Shredpix for it.

Re-encoding the image to PNG or high quality JPEG or WEBP would have indeed eliminated the need for external viewers and/or for editing tools but I also found this: Even though rate-distortion gave me immediately the amount of bytes I wanted to send, DWT was unbearably slow compared to the JPEG, PNG and WEBP tools provided by Android.

WEBP, even though I had to use bisection to find the right quality setting to fit the picture inside the 5380 bytes, was still much faster and good enough for most pictures I tested.

Same goes to JPEG 2K and XL: Slow and complicated formats and still have not found wide adoption outside the enthusiast community.

WEBP already had growing pains, just like PNG did, but now is (AFAIK) supported almost everywhere.

But, to never say never .. this is an intriguing concept and I might revisit the idea in the future.

ropucyka commented 7 months ago

Sent an random 1.67 KB JPEG image, after transfer the image size became 5.25 KB. I thought that if the image file size does not exceed 5380B then no transformation occurs and it is transmitted "as is", hash identical, but it was not so.

UPD Oh, i found that images is bit-identical, but resulting image just filled by zero bytes to achieve 5380 bytes file size.


Also found some intresting from Google, Jpegli - https://opensource.googleblog.com/2024/04/introducing-jpegli-new-jpeg-coding-library.html