Opened 8 years ago

Last modified 7 years ago

#12805 new bug

Icons inside the notification windows looks poor and distorted.

Reported by: Giova84 Owned by: pulkomandy
Priority: normal Milestone: Unscheduled
Component: Servers/notification_server Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

I noticed that the icons inside the notification window looks bad with distorted edges and details. By a comparison, I've found that the notification window will resize the icons to a dimension of 32x32 pixel. So I've done an attempt, by using Wonderbrush, to resize an icon to 32x32 pixel using the "resample interpolation" algorithm for resizing: in this way the icons will not suffer any distortion. So maybe the notification window is using a poor resizing method?

Look at the attached screenshot for a visual comparison.

Attachments (4)

Icon_Comparison.png (33.5 KB ) - added by Giova84 8 years ago.
HVIF_icons_comparison2.png (33.3 KB ) - added by Giova84 8 years ago.
screenshot4.png (105.3 KB ) - added by pulkomandy 8 years ago.
Beam-Notification.gif (69.5 KB ) - added by humdinger 7 years ago.
magnified animated gif

Download all attachments as: .zip

Change History (25)

by Giova84, 8 years ago

Attachment: Icon_Comparison.png added

comment:1 by pulkomandy, 8 years ago

I'm not sure that's a resizing problem. The icon is retrieved from the application resources, and if it's a vector icon, it is rendered at the native size directly, no resizing involved. Unless the application you are testing with only has a legacy bitmap icon, but even then, there should be a 32x32 version so no resizing would be needed.

Are you sure the problem is with resizing? Or could it be just transparency or something else?

in reply to:  1 comment:2 by Giova84, 8 years ago

Replying to pulkomandy:

I'm not sure that's a resizing problem. The icon is retrieved from the application resources, and if it's a vector icon, it is rendered at the native size directly, no resizing involved.

I'm using HVIF icons (so vector icons) and inside notification window these icons are certainly resized to 32x32 pixel: I've done a comparison with Wonderbrush: you can also try by yourself :-) If you put/paste an HVIF icon (maybe the same icon used by the notification window) near to the screenshot (eg with Wonderbrush) you will notice that the icon in the notification window is smaller: then resize the HVIF icon (which you previously placed) with Wonderbrush: before by using the bilinear resize algorithm, and you will notice that the icon will looks bad: then using the resample interpolation: the icon which you placed, will looks better, as I showed in my screenshot.

by Giova84, 8 years ago

Attachment: HVIF_icons_comparison2.png added

comment:3 by Giova84, 8 years ago

I added another image: A picture is worth a thousand words :-)

comment:4 by pulkomandy, 8 years ago

I'm not saying that there is no difference. How does it compare to rendering in Tracker, for example? It is known that the HVIF rendering is slightly different in the system code than in Icon-O-Matic, this may be another case of that problem.

There is no "native" size for HVIF icons, as HVIF is a vector format. It should not be scaled, but rendered directly at the target size, and this is what you get (unless there is a bug) in the Notification window, as well as in Tracker.

So, if the icon looks different in Tracker, it's a bug in the notification window. But if it looks the same, it's a problem (or just a different way of doing things) in the HVIF rendering code.

in reply to:  4 comment:5 by Giova84, 8 years ago

Replying to pulkomandy:

How does it compare to rendering in Tracker, for example?

The rendering in Tracker looks better and smooth (I set the icon view in Tracker to 32x32 px): see the edges and the shadow.

http://s33.postimg.org/j100tg73z/HVIF_comparison_tracker_VS_notify.png

comment:6 by phoudoin, 8 years ago

Sounds like the icon bitmap being drawn one pixel width and height too small.

http://cgit.haiku-os.org/haiku/tree/src/servers/notification/NotificationView.cpp#n270

by pulkomandy, 8 years ago

Attachment: screenshot4.png added

comment:7 by pulkomandy, 8 years ago

Here the icon looks pixel-for-pixel identical.

Tested with:

notify --icon /boot/system/apps/Beam/Beam a b c

How did you generate your notification?

comment:8 by Giova84, 7 years ago

With the same command which you used:

notify --icon /boot/system/apps/Beam/Beam test text

However, currently and unfortunately, I no longer run Haiku on my computer, since i moved my computer from one room to another: there on the new place I don't have an ethernet port available, so I connect to the router using an usb wifi adapter, which is not supported by the USB stack of Haiku. Since I need an internet connection, I "paused" Haiku.

comment:9 by Giova84, 7 years ago

Hi, luckily I'm back :-)

Well, i tested again, and I obtain the same result, see here:

http://funkyimg.com/i/2r2K6.png

the edges on the icon of the notification, still appear "sharpened"

hrev51051

by humdinger, 7 years ago

Attachment: Beam-Notification.gif added

magnified animated gif

comment:10 by humdinger, 7 years ago

patch: 01

comment:11 by humdinger, 7 years ago

It's easier to see with Magnify, here's animated gif

magnified animated gif

comment:12 by pulkomandy, 7 years ago

And I still can't reproduce the problem, the icon always look correct here. I don't see what could be different between our setups?

comment:13 by Giova84, 7 years ago

Maybe the video part/driver? Is just a guess, since seems a matter of displaying. I have a Radeon HD 6450 which is properly recognized by Haiku. I have a screen resolution of 1360x768 @ 32 bits. Furthermore, in the Appearance preflet, I have the antialiasing activated (glyph hinting - LCD subpixel). I will try to boot Haiku in VESA mode and to deactivate the antialiasing to see if there will be some difference.

comment:14 by pulkomandy, 7 years ago

No, if that was it, it wouldn't be visible in screenshots.

Font settings can be the cause however, but for a different reason: they can change the window size, which we use to center the icon vertically.

comment:15 by pulkomandy, 7 years ago

patch: 10

in reply to:  14 comment:16 by Giova84, 7 years ago

Replying to pulkomandy:

Font settings can be the cause however, but for a different reason: they can change the window size, which we use to center the icon vertically.

Well, I resetted fonts settings to all default values, and I also booted Haiku from a live cd (to ensure that no personal settings were present), but i still see notification icons as usual. Some other hints on what can I also check?

in reply to:  6 comment:17 by Giova84, 7 years ago

Replying to phoudoin:

Sounds like the icon bitmap being drawn one pixel width and height too small.

http://cgit.haiku-os.org/haiku/tree/src/servers/notification/NotificationView.cpp#n270

Did you tried to change these values in the code and see if there are differences? I would try by myself, but on this computer I have no room to build Haiku (I guess that I have to compile the whole system also only to test a single component).

comment:18 by pulkomandy, 7 years ago

These values look correct to me, a 32 pixel wide rectangle in BeOS coordinate system goes from x=0 to x=31. So I don't think it is useful to add more bugs above the one you already have.

I also tested with an icon made of only pixel-aligned horizontal and vertical lines. It shows as expected, no problems at all here.

I am using smaller than default text (size 10), but I don't know if that would make any difference.

comment:19 by axeld, 7 years ago

I guess the problem is the / 4.0; it might cause the bitmap to be drawn at a subpixel location, which could make it look messed up.

comment:20 by pulkomandy, 7 years ago

Yes, I agree with that, it is the only thing I can think of. However I would really like to reproduce the problem so I can test if ceiling this actually fixes it.

comment:21 by axeld, 7 years ago

That should be relatively simple by changing the font size? Or in the worst case, add a .25 or .5 to the computation, and check if it matches the image from humdinger.

Note: See TracTickets for help on using tickets.