Use SVG icons instead of PNG

Milan nalimilan at club.fr
Sat Feb 9 18:27:36 UTC 2008


Ioannis Nousias a écrit :
> I'm sure this has been asked before.
>
> Most of the system application launchers use PNG icons. For example, 
> Firefox and Thunderbird (two of the most commonly used apps). Very few 
> use SVG, like gnome-terminal.  I like to have few icons on my desktops 
> that are stretch to ~x2 their size. PNGs look aliased when stretched.
>
> Another case where the fixed resolution of PNGs gets in the way, is in 
> things like cairo-dock, where the application's icon in 'window list' 
> looks aliased.
>
> The obvious question is, why use PNGs and not SVG for all icons? 
> Performance?
> Also, is that theme related ? I use the 'human' theme.
>   
SVG icons have to be generated and present in the "scalable" subdirs of
your theme, or of the fallback theme ("hicolor"). Most apps already have
SVG icons, maybe some don't install them.
As for the performance side, several PNG icons are generated, one for
each common size so the system doesn't need to use the SVG version. SVG
is only used when really needed (i.e. for sizes superior to 22x22 or 48x48).

All this is developed in the freedesktop.org specification for icon
themes that you can read here:
http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
> regards,
> Ioannis
>
>
> PS: I've modified 'firefox.desktop' in '/usr/share/applications', just 
> to make sure that the default uses SVG. This works well for my desktop 
> icons, however, things like cairo-dock keep displaying a PNG icon of the 
> running firefox app. Is there something else I need to change, or is 
> this Cairo-Dock's fault ?
>   
Ideally, .desktop file should not use .png or .svg extensions, but only
the name of the icon. Every implementation will then use the preferred
actual file depending on the size (this is still from the same spec).

Concerning cairo-dock, there can be a bug, or maybe the .desktop files
it uses are copied to a static config dir, and thus are not updated. But
Cairo-dock is likely to use 48x48 icons, which are present in PNG format
- maybe I'm missing something?

Though, Firefox does not seem to have a SVG icon available: AWN uses the
48x48 PNG version. This explains why on the Desktop, it does not resize
without being aliased.


To sum up, yes, having SVG icons for every app would be good, and no, it
does not hurt performance. The best to do is reporting bugs upstream,
that should not take them too much time to fix.

Cheers




More information about the Ubuntu-devel-discuss mailing list