Telegram developers in January 2015 recognized the advantages of WebP. (“Thanks to the WebP file format, Stickers on Telegram are displayed 5x faster compared to the other formats usually used in messaging apps”, the page at https://telegram.org/blog/stickers says.)
Fast forward to 2021. The advantages of WebP are now universally recognized. Firefox has added WebP support in 2019. Apple has added WebP support to Safari 14.0 and later versions. The Web is brimming with WebP images that have never been intended to become stickers in Telegram. That images are saved in WebP just because WebP files are significantly smaller that PNG (because of WebP's better lossless compression), because WebP files are prettier than JPEG (because of WebP's less visible artifacts of lossy compression), etc.
Telegram should recognize this new abundance of WebP files and let its users decide how they intend to send their WebP files. Please allow the following three options:
as a sticker,
as an image,
as a file.
The choice of “as an image” or “as a file” is currently controlled by the setting “compress images” for JPEG in Telegram Desktop. However, having in mind much faster generation loss of WebP (see https://youtu.be/FtSWpw7zNkI for a recent video example), Telegram should refrain from recompressing WebP to WebP unless the image exceeds certain limits (for example, “larger than a megabyte”, “larger than 1280×1280 pixels”, “bytes-to-pixels ratio larger than 1”, etc.); and that limits should be made known to the users.
Telegraph (the site, not the Graph Messenger) should also recognize the new abundance of WebP files and let its users upload WebP files or embed WebP by URL. The uploaded WebP files (like the already supported PNG uploads) should not be recompressed after upload or face worse limits than the usual 5 megabytes.
Several Telegram apps (such as Telegram for Android or Telegram Desktop) now support sending WebP as an image.
This is a big step forward towards implementing this suggestion. However, only to the extent of what is possible in the apps (on the client side). Nothing's changed on the server side:
➊ WebP images are still not possible on the server side. Hence every WebP has to be recompressed to JPEG if sent “as an image”. Almost every advantage of a newer format (WebP), such as its better quality-to-filesize ratio, is thus lost. (The only exception is perhaps the results of luma-weighed chroma subsampling performed by libsharpyuv, these are not lost.)
➋ WebP files are still treated as stickers if possible. Hence there is still no choice to send your WebP “as a sticker” or “as a file”. (Unless recompressed to JPEG, the WebP file will always become a sticker in Telegram if not larger than 2 megabytes and not larger than 6553600 pixels.)
➌ Telegraph (the site, not the Graph Messenger) still does not accept WebP uploads, reports an error (“Invalid file format”).
➍ AFAIK there's not much progress in WebP support elsewhere (in avatars, on Instant View pages, in preview areas under messages hyperlinked to external WebP files or to WebP-featuring web pages, in the results of external-URL-to-embed transformations on Telegraph pages, etc.).
Some of the necessary server-side changes might seem as simple as the whitelisting of the WebP format and of the “.webp” extension. (After all, one possible workaround for external-URL-to-embed transformations on Telegraph pages is to rename WebP files to “whatever.jpg” or “whatever.gif” because it apparently is sufficient to work around Telegram's blacklist of extensions. For example, try pasting the URL of https://take-me-to.space/WFHELqi.gif on a blank line and then hitting “Enter”.)
Сергѣй Юрьевичъ Соколовъ
Some other necessary server-side changes are likely to require backwards-incompatible changes that introduce “images that are not JPEG” or “a flag to decide whether a file is a sticker”.
On the other hand, in addition to WebP, these changes will pave the road to support of even newer formats (AVIF images, JPEG XL stickers, etc.) in the future.
Telegram android still randomly fails to send webps properly depending on how I select the image from telegram. All in all this whole situation is embarrassing and shows that telegram really needs to step up their platform's quality (because this 'feature' is actually trivial to implement if you havent coded your entire service to stupidly assume that a webp file is a always a sticker and now those unbased assumptions are biting you in the ass because you have to make many breaking changes to fix it)
R
Roman Dodin
I can second that pasting webp files often leads to Telegram Desktop (macOS) to recognize them as a sticker and making the image unreadable for a sender. There is the menu that has "Without Compression" selected, can there be added a menu element to treat the image as a Not Sticker?
WebP is making inways to many software (screen capture, screenshotting) and not being able to leverage a better compressed images in Telegram is a drawback =(
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.
This is a big step forward towards implementing this suggestion. However, only to the extent of what is possible in the apps (on the client side). Nothing's changed on the server side:
➊ WebP images are still not possible on the server side. Hence every WebP has to be recompressed to JPEG if sent “as an image”. Almost every advantage of a newer format (WebP), such as its better quality-to-filesize ratio, is thus lost. (The only exception is perhaps the results of luma-weighed chroma subsampling performed by libsharpyuv, these are not lost.)
➋ WebP files are still treated as stickers if possible. Hence there is still no choice to send your WebP “as a sticker” or “as a file”. (Unless recompressed to JPEG, the WebP file will always become a sticker in Telegram if not larger than 2 megabytes and not larger than 6553600 pixels.)
➌ Telegraph (the site, not the Graph Messenger) still does not accept WebP uploads, reports an error (“Invalid file format”).
➍ AFAIK there's not much progress in WebP support elsewhere (in avatars, on Instant View pages, in preview areas under messages hyperlinked to external WebP files or to WebP-featuring web pages, in the results of external-URL-to-embed transformations on Telegraph pages, etc.).
Some of the necessary server-side changes might seem as simple as the whitelisting of the WebP format and of the “.webp” extension. (After all, one possible workaround for external-URL-to-embed transformations on Telegraph pages is to rename WebP files to “whatever.jpg” or “whatever.gif” because it apparently is sufficient to work around Telegram's blacklist of extensions. For example, try pasting the URL of https://take-me-to.space/WFHELqi.gif on a blank line and then hitting “Enter”.)
On the other hand, in addition to WebP, these changes will pave the road to support of even newer formats (AVIF images, JPEG XL stickers, etc.) in the future.
There is the menu that has "Without Compression" selected, can there be added a menu element to treat the image as a Not Sticker?
WebP is making inways to many software (screen capture, screenshotting) and not being able to leverage a better compressed images in Telegram is a drawback =(