Ditch SVGs! (was Re: svg icons again)



Hi.
exporting to plain SVGs would nuke the last remaining advantage of
shipping SVGs (inkscape's namespaced metadata). Stripping the SVG
would mean maintaining two copes of the SVG. I'd like to suggest a
more drastic, yet artist-maintainer firendly solution. I've been
having quite a few issues with using SVGs at runtime myself.

The scalable/ size is defined differently for gnome icon theme, tango
icon theme and hicolor, causing desktop icons for applications
installing to hicolor to be rendered tiny (128x128 vs 48x48px size
canvas). rsvg remains to have a blur filter rendering issue, making me
rather skeptical to see a fix soon (bug #341304). If we add a high
resolution icon to the mix (think 256x256px), the detail needs to
increase considerably and the SVG grows by tens of kilobytes and
rendering takes a lot more CPU time.

I've been trying out a new workflow -- using a 'source' SVG with all
the sizes + a script that 'walks' the SVG and exports all the icons
into individual PNGs. I'm loving it. It is much easier to do
incremental updates to the artwork, keeping all the sizes in visual
sync (instead of travelling the filesystem and using awkward ways to
see the icons side by side).

All this made me think we don't really need to use the SVG at runtime.
It's super useful to have the source artwork in vectors, but the
advantage of actually using the SVG at runtime is minimal if any.

Here is sample icon[1], plus the script[2] I've written to render the
bitmaps. The canvases are defined by empty rectangles in the lower
layer, the context and output size of the bitmap is defined as an
Inkscape label (Ctrl+Shift+O in Inkscape).

My proposal is to render scalable/ into 48x48, set it to Type=Fixed or
Threshold (although I wish GNOME followed the spec in that area) and
add the 256x256 size being bitmaps, yet Type=Scalable. The source svg
artwork would not get installed/packaged.

cheers

[1] http://jimmac.musichall.cz/stuff/svg-workflow/svg/computer.svg
[2] http://jimmac.musichall.cz/stuff/svg-workflow/render-bitmaps.rb

On Jan 27, 2008 2:24 AM, Matthias Clasen <matthias clasen gmail com> wrote:
> I've recently noticed that a lot of the svg icons that are shipped in
> our software are very bloated.
> Bloated svgs not only eat disk space (which is a problem on live cds),
> they also cause unnecessary
> overhead every time they have to be rendered.
>
> I've asked the fedora art team for help, and Nicu gave some nice tips:
> http://nicubunu.blogspot.com/2008/01/unbloat-your-inkscape-made-svgs.html
>
> Running inkscape --vacuum-defs --export-plain-svg over the
> Tango/scalable tree, I see
> a size reduction from 12M to 8.5M, which is a remarkable 30% space
> win. It would be great
> to see this applied not only to Tango, but to all the svgs that we ship.
>
>
> Matthias
> _______________________________________________
> gnome-themes-list mailing list
> gnome-themes-list gnome org
> http://mail.gnome.org/mailman/listinfo/gnome-themes-list
>



-- 
even a stopped clock
gives a right time twice a day

Jakub Steiner <jimmac gmail com>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]