• Copy Link
Stop server-side JPEG-to-JPEG recompression
Сергѣй Юрьевичъ Соколовъ, Jan 24, 2021 at 06:32
OpenSuggestionGeneral

A contributor to Telegram Desktop has once said at https://github.com/telegramdesktop/tdesktop/issues/5317#issuecomment-502341782 that it's not useful to raise the quality of JPEG photoes compressed by client-side applications because “the server itself compresses the photos” and “most of the compression is performed by the server”.

Hence the suggestion that is very simple: Telegram should stop performing server-side JPEG-to-JPEG recompression because such recompression has several important demerits.

Server-side JPEG-to-JPEG recompression makes it nonsensical to improve client-side JPEG compression. Telegram Desktop's decision to use MozJPEG (see https://github.com/telegramdesktop/tdesktop/pull/8787 for details) and the same (earlier) decision of Telegram for iOS (see https://github.com/TelegramMessenger/Telegram-iOS/commit/e1432e41711f5b114e338e81522ad73a3f4f5645 for details) does not mean much if the server then uses some visibly worse JPEG encoder that cannot even generate progressive JPEG (see https://t.me/kepka_support/15058 for details).

Server-side JPEG-to-JPEG recompression results in generation loss (see https://en.wikipedia.org/wiki/Generation_loss for the definition). The most popular pictures (the pictures that are saved and sent again the most often: the memes, the spectacular photoes, the screenshots of awesome news, etc.) are the most “punished” by the quality loss.

Server-side JPEG-to-JPEG recompression is likely to incentivize unofficial clients to create JPEG files of exorbitant quality (when compressing PNG-to-JPEG, for example) and thus to lengthen the delivery in order to ensure that the only quality loss is server-side.

Server-side JPEG-to-JPEG recompression is costly. It involves the expenditure of the precious server-side CPU cycles (and these are so precious that Telegram intentionally refrains from GIF-to-MP4 recompression of files greater than 10 megabytes despite the larger filesize-related gains for them). In addition to that, and perhaps more importantly, server-side JPEG-to-JPEG recompression also generates (because of the generation loss) many files containing the same image on different stages of recompression and thus the expenditure of server-side storage for all of these files.

Telegram should get rid of all that demerits: Telegram should rely solely on client-side JPEG compression. The only server-side JPEG processing should be simple (not CPU-intensive) tasks such as removing of geotags (for the sake of better privacy) and trimming the files' tails (to prevent any RARJPEG) and the inevitable check of images' parameters to enforce the simple set of rules that are imposed on client-side JPEG compression; and these rules should be made public.

For example, compressed images in Telegram cannot exceed 1280×1280 pixels, and thus server should reject client-sent JPEG images wider or higher than this limit with an error (instead of attempting to recompress).

For example, Telegram servers can reject large JPEG files with an error if the file is larger than, say, one or two megabytes.

For example, Telegram servers can reject JPEG files based on their bytes-to-pixels ratio, requiring no more than 6 or 7 bits (of the encoded files) per pixel on average (not to be confused with https://en.wikipedia.org/wiki/8-bit_color of the decoded images).

1193Copy link
Comments9
Show 4 more comments
Serhii Popov Jun 18, 2021
You can send jpgs without recompression in Telegram already. Select pictures, tap three dots menu and select "Send without compression".
But I think it's a nice default to rescale and recompress images so they don't take much space.
Сергѣй Юрьевичъ Соколовъ Jun 18, 2021
Serhii Popov
You can send jpgs without recompression in Telegram already. Select pictures, tap three dots menu and select "Send without compression". But I think it's a nice default to rescale and recompress images so they don't take much space.
A common case is that the picture, if passed through Telegram channels, has already been recompressed twice or thrice: once when sent, once again on the server side, maybe once again if saved from Telegram Desktop. If you need to repost that picture, can you decide that it's not compressed enough (despite all the previous attempts to compress it) and justify its further recompression by the argument “so it doesn't take much space”? — also that argument may already be invalid if Telegram uses some single-instance storage (see https://en.wikipedia.org/wiki/Single-instance_storage for the definition) and an exact copy of the file is much cheaper than the recompressed version.
Khaled [E] Dec 11, 2021
Maybe offer conversion options in the client. Like video quality options for videos.
Сергѣй Юрьевичъ Соколовъ Mar 9
Сергѣй Юрьевичъ Соколовъ
Likewise, Telegraph (the site, not the Graph Messenger) should also stop its own server-side JPEG-to-JPEG recompression. Telegraph should keep uploaded JPEG files “as is” (like it keeps uploaded PNG files already) and only impose the usual Telegraph's limit on filesizes (5 megabytes). Telegram Desktop should also refrain from further client-side JPEG-to-JPEG recompression when its users save JPEG files. Any saved JPEG files should be saved exacty as they were received.
A fix for one of the aforementioned issues (“Telegram Desktop should also refrain from further client-side JPEG-to-JPEG recompression when its users save JPEG files”) is delivered in Telegram Desktop 3.5.6 beta.

Its changelog at https://github.com/telegramdesktop/tdesktop/releases/tag/v3.5.6 says “Always try to save original photo bytes to disk”.
Сергѣй Юрьевичъ Соколовъ Apr 30
A further improvement is delivered in Telegram Desktop version 3.6.0 (see https://github.com/telegramdesktop/tdesktop/commit/6805259f74a163ea851fee0e1ae743e81bf75c61 for details).

Telegram Desktop no longer recompresses a JPEG file before sending if the following four rules are obeyed by that JPEG:

① JPEG format is progressive,

② JPEG's width is 1280 pixels or less,

③ JPEG's height is 1280 pixels or less,

④ JPEG's filesize is 4 bits (or less) per average pixel.

Such JPEG files are nevertheless recompressed (JPEG-to-JPEG), but only once (on the server side).
Login
  1. Bugs and Suggestions
AllIssuesSuggestions
by rating by time

13464 Cards

Added
About this platform
All users are welcome to create new entries, view existing entries and vote on them. What is this for? This platform is a place where users can vote for feature suggestions for Telegram or report issues…
Dec 23, 2020ClosedTip
64214
Fixed
iOS badge counter shows unread messages, even when all chats are read
Badge counters inside the app and on the app's icon may sometimes show unread messages while there are no unread chats in the list. Workaround Tap 10 times on the Settings tab icon > Reindex Unread Counters.…
Nov 12, 2020Issue, iOS
51200
Fixed
[Android 11+ SDK 30] Auto save to gallery does not work
Despite the fact the 'Save to Gallery' option is enabled in Settings > Chat Settings, still I don't see media in my phone's gallery. Steps to reproduce 1. Enable 'Save to Gallery' in Settings > Chat Settings …
Nov 7, 2021FixedIssue, Android
108113
Fixed
Incoming disappearing media with timer is blurry
Temporal media cannot be seen since it looks blurry for Android devices that receives it. Steps to reproduce 1. Receive a media with self-destruction timer in a cloud or secret chat. Current result Media…
Jun 20Fix comingIssue, Android
4460
0:52
Fixed
Automatic saving of incoming photos doesn't work
Workaround Disable Automatic Media Download and manually download the images. Automatic saving of incoming photos doesn't work, after the February update (v 7.5) Sometimes random old photo from telegram…
Feb 24, 2021Issue, iOS
4656
Added
Flag of Karakalpakstan Republic
Please add official flag of Karakalpakstan Republic into smiles. It's sovereign republic into Uzbekistan. You can find official flag here https://upload.wikimedia.org/wikipedia/commons/1/16/Flag_of_…
Dec 29, 2021ClosedSuggestion, Android
66212674
Added
Shadowsocks Support
Add Built-in VMess, Shadowsocks, SSR, Trojan-GFW proxies support The ( vmess / vmess1 / ss / ssr / trojan ) proxy link in the message can be clicked
Apr 11, 2021Suggestion, General
884760
Added
Emoji reactions
An option to react to messages using small emoji (e.g.👍,❤️,👎) instead of replying in the chat with messages or stickers. Use Cases 1. Quick feedback that doesn't take up space in the message history.…
Nov 5, 2019FixedSuggestion
8302846
Added
Improve the ability to search chat history for Asian regional languages, such as Chinese and Japanese
Improve the ability to search chat history for Asian regional languages, such as Chinese and Japanese. Telegram's chat history search function is based on words, and is suitable for languages such as…
Dec 23, 2020Suggestion, General
952805
Added
Silent sign up
A feature to join Telegram incognito, making the phone number privacy set to Nobody before creating a new account. Current users who have that number added to their contacts list will not get a new c…
Dec 12, 2019Suggestion
1101766
Added
Group Video Calls
Group Video Calls has been implemented in June 2021. Related suggestions: Group Video Calls with Contacts, Screen Sharing in private chats.
Dec 11, 2019FixedSuggestion, Calls
911635
Added
Cryptocurrency donations for bots, groups and channels
Show a button for sending quick donations to maintainers of bots, groups or channels using cryptocurrency. This could use either an established cryptocurrency like Bitcoin, Etherium, EOS, etc. – or some…
Dec 25, 2020Suggestion, General
891558
Added
Screen sharing in calls
Screen sharing from mobile and desktop apps, in one-on-one calls and voice chats (also in group calls when they become available).
Dec 23, 2020FixedSuggestion
981499
Added
The sticker text is covered of the time of the message
The time of the message is displayed on the sticker. It is not comfortable to read sticker. It often happens that time covers part of the text on the sticker. And if the sticker is sent from the channel…
Mar 20Suggestion, Android
11497
Added
Choose a different default folder instead of "All Chats"
An option to pin one of your folders as the main folder instead of All Chats. When you open the app, it would show you the folder you chose. Pressing the back button would bring you back there when you're…
Nov 16, 2020Suggestion
571284
1:52
Added
Emergency passcode to hide chats
Option to set an alternative passcode ("double bottom") that either opens a limited set of chats, opens a different account, or destroys one of the connected accounts completely when entered. Use cases…
Feb 27, 2021Suggestion
401232
Added
In-app translator
Added In-app translator has been implemented in December 2021. Available on mobile apps from Settings > Language. Translating specific messages via the context menu like Twitter does for tweets. Use…
Nov 5, 2019FixedSuggestion
961209
Added
Chat permissions: Can Talk
Please add chat permission: Can Talk. How it works If it's enabled, user can talk in a voice chat. Otherwise user is muted. For users In apps it would be useful for chat owners - they will be able to…
Aug 3, 2021Suggestion, General
151204
Added
Live video streaming
A feature to share and experience live videos across groups and channels in Telegram. Broadcasting from a channel or your personal account (in group chats) so that others can view, react, and interact.
Dec 12, 2019FixediOS, Android, macOS, Telegram Desktop, Suggestion
751080
Added
Unlimited favorite stickers
Increase the limit for favorite stickers. The current limit is five stickers. When you add another one, the first sticker is replaced. Use cases Choose a limited set of stickers which you will always…
Dec 11, 2019Suggestion
581047
Added
Notify all group members
An option to notify all group members or admins using a special mention (e.g. @all and @admins). Use cases Important news and major updates in big communities. Potential issues Some group admins already…
Nov 4, 2019Suggestion
851002
Added
Alternate profile pictures
When setting a profile picture or video that's only visible to contacts (or certain users, groups etc.), allow choosing an alternate picture or video that will be shown to everyone else. Use cases -…
Nov 17, 2020Suggestion
51913
Added
Allow site owners to make their own Instant View templates
Instant View templates are currently created and maintained by Telegram, the list of supported websites is expanded gradually. Some site owners would like to get IV support for their websites sooner.…
Jan 23, 2021Suggestion, General
47865
Added
Add Instant View to Telegram Desktop
Add Instant View to Telegram Desktop. The feature is there right now for MacOS Telegram App, but missing from regular Telegram Desktop. Preferably, it should open an article in the existing telegram window…
Dec 23, 2020Suggestion, Telegram Desktop
29765
Added
Stories / Statuses
An option to share moments (media, like photos or short videos, texts, etc.) with your mutual contacts (this can be adapted with granular privacy permissions) to view, interact, and forward. Such statuses…
Dec 12, 2019Suggestion
707754
Added
Disable "New Contact Joined" chats
Users receive a notification when one of their contacts becomes available on Telegram. It is currently possible to disable the notification: the new chats will appear in the list without sending a notification.…
Dec 11, 2019Suggestion, General
49691
Added
Partial reply
Reply only on parts of a message. This would be very useful, if someone wrote a very long message and you only want to refer to one or two sentences - or even only one or a few words.  If you click on…
Jan 23, 2021Suggestion, General
44673
Added
Custom icons for folders
Add the ability to choose icons for folders on mobile platforms – like in Telegram Desktop and Telegram macOS. Sync them on all devices. Use cases - Find folders you're looking for more easily. - Save…
Nov 17, 2020Suggestion, iOS, Android
13645
Added
Better global search
Make global search a place to find all communities in channels and public chats.
Feb 9, 2021Suggestion, Android
22629
Added
Transfer ownership if creator account was deleted
Option to transfer ownership in groups and channels if the creator was deleted so the first admin with all permissions will become a creator! Thumbs up if you want this to happen 👍 App: all
Dec 24, 2020Suggestion, General
72590
Added
Call transfer between devices
An option to seamlessly transfer ongoing voice and video calls between different devices with one account: e.g., from a mobile phone to a desktop PC and vice versa.
Dec 23, 2020Suggestion, General, Calls
15566
Added
More Two-Factor Authentication methods
An option to add an authenticator app with temporary, one-time passwords (e.g. Authy, Google Authenticator) as another second factor.
Nov 5, 2019Suggestion
20556
Added
An option for a channel/group owner to better interact with subscribers without the risk of being reported as spammer by trolls.
An option for the owner of a channel or a group to set a visible flag informing all new members that they might be privately contacted one single time by the owner/admins of the channel/group they are…
Feb 26Suggestion, General
10545
Added
Requests to join group or channel
If enabled, the user attempting to join the group/channel will only be able to view the content and send things after being accepted by an administrator (optional: only admins who have the "accept/decline…
Nov 23, 2020FixedSuggestion, General
155541
Added
Different background images for each chat
A feature to set a individual wallpaper for specific chats. (f.e. One wallpaper for a specific group, another for a chat with a friend...) Use cases This would make navigation between chats easier, especially…
Nov 5, 2019Suggestion, General
36539
Added
Separate passcode lock for specific chats or Archive
Option to lock certain chats with a separate passcode. On a chat-by-chat basis, or for an entire Chat Folder, e.g. the Archive. Use cases Family iPads and other shared devices. Can also be used in environments…
Nov 5, 2019Suggestion
23522
Fixed
Telegram downloads images instead of using bitmap data from clipboard
When I paste an image copied from Firefox, Telegram downloads it again instead of using the bitmap data from the clipboard. This happens because the clipboard also stores the image URL. If I paste the…
Jun 27, 2021Issue, Telegram Desktop
4477
Added
Please Add a Clear Response button/ Retract response button in the Poll (Quiz mode) too for admins of the channel and subscribers of the channel
Hello Sir/Ma'am. I would like to draw the attention of the Telegram app to an important suggestion/request. I run telegram channels which consists of more than 50k+ Highly active students who solve quiz…
Feb 5Suggestion, Android
68456
Added
Hide messages from blocked users in groups
Sometimes you don't want to see messages from people you blocked, even in the groups you share with them. Such messages could be automatically collapsed and hidden under a spoiler (like 'You blocked Doge.…
Nov 5, 2019Suggestion
99438
Added
Tmail - Telegram Email Service
Telegram is a great messenger, but it can also be a great Email service. So without further introductions, let's start. Mail app can be separated or it can simply be integrated inside the Telegram messenger…
Jan 24, 2021Suggestion, General
47426
Added
Syntax highlighting in code blocks
An optional extension to the backtick syntax to specify a language to highlight. Similar examples are the likes of Gitlab and GitHub comments.
Dec 27, 2020Suggestion, General
24413
Added
Remove or modify Telegram ad features
I really do wish that Telegram would reconsider putting up sponsored ads in channels. I've always kept it as my safe zone while the rest of the internet is saturated with ads. If the ads are going to…
Dec 9, 2021Suggestion, Android
60391
Added
Starred Messages
An option to bookmark/star a message. Marking a message would add it to the separate Starred Messages section on the profile page, for quick access to messages. While Telegram doesn't have Starred Messages…
Dec 12, 2019Suggestion
73390
Added
Show folders when forwarding a message
An option to see your folders when sharing or forwarding messages. Use case Find the chats you were looking for more quickly. Workarounds - Use the search option to find the chat if it's not at the top.…
Nov 17, 2020Suggestion
7371
Added
Way to mark messages as sensitive
An option to mark a message or photo as sensitive before sending. Sensitive messages can be revealed or re-hidden with a tap and default to hidden when a chat is opened. App: all
Dec 23, 2020Suggestion, General
10355
Added
Privacy settings for Bio
The Bio section in Telegram profiles is currently always public. Add an option to configure 'Who can see your bio?' to the Privacy and Security Settings. Use cases Putting more sensitive or private info…
Nov 5, 2019Suggestion
17354
0:08
Fixed
Inline keyboard buttons become unresponsive when the menu is edited after tapping on a button
Workaround Rotate your phone and then tap on the desired button. Inline keyboard buttons become unresponsive with the new "menu transition" animation that appears when the menu is edited after tapping…
Dec 29, 2021FixedIssue, iOS
27349
Added
Sign up for Telegram without a phone number
You currently need a phone number to sign up for Telegram. Add an option to sign up using an email address or another method, like some messengers do (e.g., Wire, Matrix, Threema, Session). Potential…
Dec 30, 2020Suggestion, General
101346
Added
Secret Chats on Telegram Desktop
An option to create Secret Chats using the multiplatform Telegram Desktop client.
Jan 5, 2021Suggestion, Telegram Desktop
21338
Added
Change file names in Telegram
Option to change file name on Telegram without needing to re-upload the file. App: all
Dec 24, 2020Suggestion, General
19335

Log In

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.

Cancel
(Incorrect?)

We've just sent you a message.
Please confirm access via Telegram

CancelBack