tdesktop icon indicating copy to clipboard operation
tdesktop copied to clipboard

Image antialiasing

Open hatkidchan opened this issue 1 year ago • 21 comments

Steps to reproduce

  1. Send image as a document
  2. Open it in fullscreen

Expected behaviour

Image should be smoothed (same image as on the screenshot below, opened in sxiv with antialiasing enabled) image

Actual behaviour

Image is not antialiased (looks noisy and crispy, pay attention to power lines) image

Operating system

Arch Linux

Version of Telegram Desktop

4.8.10

Installation source

Static binary from official website

Crash ID

No response

Logs

No response

hatkidchan avatar Aug 08 '23 12:08 hatkidchan

Apparently that problem is universal between a lot of Telegram clients, including mobile for Android and iOS. Is that a design decision? Would be nice to have either an option to toggle anti-aliasing, or just have it enabled when image size is <100%. When you zoom in to make them more than 100% of their size, images do look anti-aliased

hatkidchan avatar Aug 08 '23 12:08 hatkidchan

Could it be that you have enabled some experimental settings or the "Installation source" value is not right?

ilya-fedin avatar Aug 08 '23 13:08 ilya-fedin

Could it be that you have enabled some experimental settings

Most likely not

or the "Installation source" value is not right?

Noticed on version from Arch repos, tested on release from GitHub, still happens, so not the case either

hatkidchan avatar Aug 08 '23 15:08 hatkidchan

Most likely not

Can you check? The experimental settings menu also has a convenient button to reset all the changes in that menu.

ilya-fedin avatar Aug 08 '23 16:08 ilya-fedin

My settings were:

Experimental:
    Shot tabbed panel by click              YES
    Enable precise High DPI scaling         NO
    Add "View Profile"                      YES
    Allow OpenGL on NVIDIA drivers (Linux)  NO
    Use small message bubble radius         YES
    Disable auto-play of the next track     NO
    Send large photos                       YES
    Mono settings and menu icons            YES
    Enable webview inspecting               YES
    Mark as read of inactive chat           NO
    GNotification                           NO
    FreeType font engine                    OFF (locked)
    External video player                   NO
Performance:
    Battery and Animations                  (all off)
    Hardware accelerated video decoding     NO
    Enable OpenGL rendering for media       YES

Tried resetting them to default values, still happens. Also happens when I disable "Enable OpenGL rendering for media"

hatkidchan avatar Aug 08 '23 18:08 hatkidchan

Are we talking about compressed images or not?

ilya-fedin avatar Aug 08 '23 18:08 ilya-fedin

Nope, uncompressed, sent as documents

hatkidchan avatar Aug 08 '23 18:08 hatkidchan

can you upload a reproducing image?

ilya-fedin avatar Aug 08 '23 18:08 ilya-fedin

IMG_20230721_160511

Not sure if it would be visible on screens with resolution higher than 1080p, since it's scaling problem

hatkidchan avatar Aug 08 '23 18:08 hatkidchan

I see it like actual behavior straight from github page opened with firefox. I guess it's an advanced feature that only image viewers implement, not applications where image viewing is not the main use-case. Particularly, tdesktop just uses QImage::scaled.

ilya-fedin avatar Aug 08 '23 18:08 ilya-fedin

For me it looks fine on github page also in firefox; checked how Discord handles that and it also uses anti-aliasing (though that's to be expected, it's electron-based)

hatkidchan avatar Aug 08 '23 19:08 hatkidchan

Probably could be changed by switching to Qt::SmoothTransformation?

hatkidchan avatar Aug 08 '23 19:08 hatkidchan

For me it looks fine on github page also in firefox;

Apparently we use different firefox-es? изображение

Probably could be changed by switching to Qt::SmoothTransformation?

I believe SmoothTransformation is already used, it would look way worse without it.

ilya-fedin avatar Aug 08 '23 19:08 ilya-fedin

Apparently we use different firefox-es?

Uhhh.. I'm on 116.0.1, not sure if there are any settings to change smoothing image

I believe SmoothTransformation is already used, it would look way worse without it.

https://github.com/telegramdesktop/tdesktop/blob/38941eb3c8efc556f9dbf27f881464f6945cc34f/Telegram/SourceFiles/data/data_document_media.cpp#L97-L104

Is it used only when image is zoomed in?

hatkidchan avatar Aug 08 '23 19:08 hatkidchan

I'm on 116.0.1

I'm on 177.0b3 binary from the official website

Is it used only when image is zoomed in

I don't know... I seem to fail to find the code that scales the image in the viewer.

ilya-fedin avatar Aug 08 '23 19:08 ilya-fedin

Hey there!

This issue was inactive for a long time and will be automatically closed in 30 days if there isn't any further activity. We therefore assume that the user has lost interest or resolved the problem on their own.

Don't worry though; if this is an error, let us know with a comment and we'll be happy to reopen the issue.

Thanks!

github-actions[bot] avatar Feb 05 '24 01:02 github-actions[bot]

Still applicable, but not sure what could be done about it. I doubt it's a high priority anyways, and I can't even test it even if I find the cause (building Telegram from source is just not possible for me). Maybe I actually should revisit it

hatkidchan avatar Feb 06 '24 13:02 hatkidchan

Example post with aliased images: изображение

https://t.me/win1leaks/3557

soredake avatar Jun 07 '24 19:06 soredake

Personally I still fail to see any application doing what is requested here. Firefox still presents me the same result as tdesktop. My system image viewer (Gwenview) does the same, too. This makes me think there's no issue on tdesktop side and everything is working as intended.

ilya-fedin avatar Jun 07 '24 20:06 ilya-fedin

I don't know, in my case, I see aliasing only in Telegram Desktop (1), but not in Firefox (2), or sxiv (3), or feh (4). eog does show it with antialiasing, but the moment I take a screenshot, it disables it for some reason, so not sure if last screenshot (5) is antialiased or not

image image image image image

hatkidchan avatar Jun 07 '24 20:06 hatkidchan

Ok, I will just unsubscribe from the issue.

ilya-fedin avatar Jun 07 '24 21:06 ilya-fedin