The difference between sending an image (as wide as the message) and sending a file (iconified and accompanied by a filename) is represented in Telegram's user interface by the concept of compression; for example, “files” are sent from Telegram on Android if “Send without compression” is chosen, “images” are sent from Telegram Desktop if “Compress images” checkmark is checked.
However, sometimes JPEG compression is not really necessary for the images and they could be better delivered without compression.
Twitter understands that. Since January 2019 (see https://twittercommunity.com/t/upcoming-changes-to-png-image-support/118695 or the attached screenshot of the most relevant part) Twitter refrains from delivering PNG images as JPEG if the image is small enough (does not exceed 900×900 pixels), or if the PNG format implies that its pixels are already better compressed than any decent JPEG could (1-bit, or 2-bit, or 4-bit, or paletted 8-bit pixels in PNG), or if an attempt to compress PNG to JPEG is actually made but it results in a larger file.
Hence my suggestion here is that Telegram could really follow Twitter's example or at least follow the best part of it: deliver PNG images “as is” (instead of compressed in JPEG) where such compression results in larger JPEG files.
It looks so silly when a Telegram client compresses PNG image to JPEG and it immediately knows that the resulting JPEG file is larger (and thus it would be faster to deliver the uncompressed PNG) and that JPEG's quality is also worse (because of the generation loss; see https://en.wikipedia.org/wiki/Generation_loss for the definition), but then that JPEG is still sent nevertheless. It looks silly, but still it happens. You can see it for yourself in three steps:
2️⃣ Post that file in Telegram from Telegram Desktop version 2.5.8 (in the “Compress images” mode). I've just posted https://t.me/tginfochat/1056537 for example.
3️⃣ Use Telegram for Android v7.4.2 (2227) to download the resulting JPEG and see that is 173184 bytes long (116.69% larger than the original PNG; that's more than twice as larger).
(You have to use Telegram for Android to see the real filesize because Telegram Desktop further compresses JPEG files when saving.)
Now you know that some images (such as screenshots) could be delivered much faster (about twice as fast, in fact) if the client refrains from “compressing” them to JPEG format. Smaller PNG files could also lessen server-side storage costs.
The client is not the only place where such compression is to be avoided. Some further JPEG compression happens on the server side, and in the case of such small PNG files that compression should be avoided likewise. (Alternatively you may decide to vote for the suggestion Stop server-side JPEG-to-JPEG recompression #1058 where the full stop of server-side JPEG compression is proposed.)
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.