Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> [Vector format] means that you only need one file per icon; it doesn’t matter how many sizes you want to render icons at.

That's not really true, even with vectors it's good to have different images for different sizes, that add details (for larger sizes) or remove details and increase component sizes (for smaller sizes), so the icons look good at different sizes. You can see in the tape recorder icon the author shows: at larger sizes, it looks much better than the bitmap images, but at smaller sizes the bitmapped icons look better; the vector icons become a mush of unclear elements. The bitmap shows pieces as proportionally larger than they should be, so the visual elements that you consider important still show clearly.



There is a feature of HVIF, called level of detail, that lets you vary what shapes appear according to the display size. You can find it in the Icon-o-Matic documentation. Ctrl-F for "LOD" in https://www.haiku-os.org/docs/userguide/en/applications/icon...


So like media queries, in CSS? That's neat.



That's pretty cool!


Very interesting


That's good, although you also want to change the size of things—make the remaining details larger at smaller sizes, so they show more clearly. Cape Cod is really narrow, but for a small US map you still want it clearly defined :-)


I imagine you would support that by showing the larger shape while hiding the smaller one in the small icon, and showing the smaller shape while hiding the larger one in the large icon.


That kind of goes back to having one file per size, in terms of space. Although it's more flexible and might be easier to maintain.


Having one vector file per size would involve each file being close to constant size. Adding one resized shape only adds twenty-some bytes (a few headers/indexes, plus the transformation matrix); this is a lot less than a whole new file.


This is something that irritates me about high dpi displays. If you have a small 16x16 icon and go to high dpi, often a regular 32x32 icon is used. So you just use a larger low dpi icon. The problem is that the icon at the same physical size now has much more details and looks less clear. The correct thing to do would be to have a separate 16x16@2x icon with 32x32 pixels, that is intended for the same physical size as the original 16x16 icon.


>So you just use a larger low dpi icon. The problem is that the icon at the same physical size now has much more details and looks less clear.

In what way does it look "less clear"?

The problem with showing more details on the low-dpi screen for a 16x16 icon was the low resolution of the screen.

A hi-dpi screen doesn't have this issue. It's effectively showing 32x32 quality on the 16x16 "virtual pixel" size.

At worse, it would have looked as good as a 32x32 icon in a low-dpi screen. But in the hi-dpi it looks even better, much sharper and refined. You're getting an icon that's as good as a 32x32 icon would be on a low-dpi screen, but with half the physical size, so that it appears twice-as-detailed as a 16x16 icon would be.


The top comment in this thread details why it looks clear: some icons have different proportions for different icon sizes to make sure things look okay. So the problem is that proportions planned for one physical size are used for a smaller physical size.


16x16 and 32x32 allow for the same proportions though (including alpha-ed out pixels).

And if the icon looks ok in 32x32 on a low-dpi screen, it will look doubly so as a 16x16 virtual pixels with doubled resolution underneath in a high-dpi one.


a 256x256 keyboard icon, is going to look pretty bad at 1cm x 1cm

A bunch of details really close together looks like noise, not information


Not necessarily. When the first iPhone came out with retina display I eventually realized that the contacts app had incredibly tiny letters on the tabs. It was only visible if you looked very closely but was an amazing touch of polish.


That's actually what the Gnome Desktop Environment (GDE) does. They have separate images for each icon size, but use vector graphics so they're easier to edit.


>Gnome Desktop Environment (GDE)

Is this a common acronym?


No. The official acronym is GNOME, AFAIK.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: