Log in here to report bugs or suggest features. Please enter your phone number in the international format and we will send a confirmation message to your account via Telegram.
We've just sent you a message.
Please confirm access via Telegram
The JPEG XL Image Coding System (ISO/IEC 18181, see https://jpeg.org/jpegxl/ for details) offers lossless transcoding from JPEG to JPEG XL and back again.
The results of such transcoding are noteworthy: the page at http://sneyers.info/jxl/ will tell you that transcoded (JPEG XL) files are typically about 20% smaller than JPEG sources.
The reference implementation is available at https://gitlab.com/wg1/jpeg-xl and its description says that the bitstream is frozen (the encoded files can be decoded with future decoders of the format).
Telegram is likely to transport JPEG images faster and also store them more efficiently if Telegram chooses JPEG XL as the lossless transport&storage format for JPEG files.
JPEG XL's decoding will indeed require some CPU time (and battery's electricity on mobile devices). However, that cost is small and also shifted from Telegram to its users who collectively will shoulder it almost effortlessly.
How small exactly is that cost? — well, the most recent version of the reference implementation, unfortunately, has an issue that unbearably slows down the decoding of JPEG files (see https://gitlab.com/wg1/jpeg-xl/-/issues/120 for details); however, I've tried one of the previous versions (v0.2.0), and that version happily decodes more than 37 megapixels per second (on Intel Core i7-3770). Its not hard to imagine numerous Telegram users quite willing to trade a small fraction of a second for the 10% or 20% faster delivery of every JPEG file (especially in some developing countries and even in some European countries where Internet speed values leave so much to be desired).
And if we need a new one anyway, we can take something better like WebP or AVIF-image.
② If you believe that WebP images should be supported in Telegram (in addition to the already supported WebP stickers), consider voting for the WebP-related suggestion at https://bugs.telegram.org/c/1021
③ However, the argument “It can't even be shown with a normal JPEG viewer” is not correct within the scope of this suggestion because a JPEG file can be losslessly transcoded to JPEG XL format (to be stored efficiently, to be delivered faster) and then such JPEG XL can be losslessly transcoded (by a Telegram client) back to JPEG when the user decides to save the image in a JPEG file or to show the image in any JPEG viewer.
④ Hence AVIF and WebP, though also better formats than JPEG (in terms of quality-to size ratio and of compression artifacts' appeal), are worse than JPEG XL within the scope of this suggestion: unlike JPEG XL, they do not offer lossless recompression of JPEG and thus they would incur generation loss (see https://en.wikipedia.org/wiki/Generation_loss for the definition) for every transcoding from JPEG and to JPEG.
Another JXL-related TG issue for general support of the format is here https://bugs.telegram.org/c/15667