Use SVG icons instead of PNG

Ioannis Nousias s0238762 at sms.ed.ac.uk
Sat Feb 9 22:36:11 UTC 2008


Milan wrote:
> 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).
>   
I can see how that works in static/specific icon sizes, but considering 
the numerous visual effects we get on our modern distros these days, in 
most cases we are dealing with dynamically changing icons. Cairo-dock is 
one example, several compiz plugins (like shift-switcher, scale or even 
zoom) are some more. And with 'resolution independence' coming in the 
near future, I can't see how PNG could 'survive'. You would need a 
fairly high resolution PNG as a bases to avoid aliasing. And as you 
said, resizing a pixmap isn't necessarily less computationally intensive 
than rendering vector graphics. (well, it depends I guess)


> 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).
>   
thanks for the tip. sensible approach.

> 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?
>   
you are probably right about the local copies of .desktop files (I 
haven't looked at this yet though). Cairo-dock is using SVGs for its 
launchers.

> 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.
>   
out of the 273 .desktop files in my /usr/share/applications, 31 use explicitly .png suffix in their 'Icon' field, 7 use .svg, 8 .xpm and the rest don't specify a suffix. Where should I file a bug report for this? It would be cumbersome to file a bug report for each application that does not conform to the standard.







More information about the Ubuntu-devel-discuss mailing list