[bt-devel] SVG to PNG conversion: try Inkscape

Greg Hellings greg.hellings at gmail.com
Fri Feb 27 22:34:40 MST 2009


Jonathan,

On Fri, Feb 27, 2009 at 9:11 PM, Jonathan Marsden <jmarsden at fastmail.fm> wrote:
> Greg Hellings wrote, quoting me:
>
>>> If you need me to email you a tar.gz (or even a .zip) file containing
>>> all 79 .png files I created (in about 14 seconds) by running the above
>>> command in my bibletime-1.7 pics/icons/ directory, let me know :)
>
>> Probably the better thing to do would be to provide them to Eeli, so
>> he can test them and then decide whether or not to include them with
>> the actual Subversion.
>
> Hmmm.  The smiley there was intended to indicate that it shouldn't
> really be necessary to do that, because generating the PNGs for yourself
> is so straightforward, now that you know about Inkscape.

I do - but I haven't installed it in Windows and thus don't yet know
if it has a command-line mode in Windows or not (in my experience,
some Windows programs do not have a command-line only operation mode
that is fully functional when their corresponding Linux/Unix builds do
- like CMake for instance).  I also know absolutely nothing about DOS
batch programming.  I figured, since you already have done the
conversion, why should I replicate your work?

>
> Further, as I see it, the PNG files are derived from the SVG, and are a
> less desirable form in terms of further editing (being raster graphics
> not vector).  So the SVG files should be considered the "source form" of
> the images, and stored in the VCS.  Cmake or whatever build tools are in
> use should generate PNG files as part of the build process, if having
> PNG files for these icons at install time is desired.  You really do not
> want to have to keep and track two sets of icons in your VCS, differing
> only in graphics file format -- it's highly likely that at some point
> they will get out of sync with each other and cause confusion, or
> hard-to-track-down bugs.

Perhaps this is true - I know there are ways to add post-commit hooks
into SVN to execute commands on the server after a file has been
added/updated.  I suppose that it could be configured so that every
time an SVG is added to the VCS tree, its PNG is updated
automagically.  Or perhaps someone chooses to change BibleTime to the
PNGs instead of the SVGs as the master.  For images as small as a
button icon, it seems that the argument of vector/raster is rather
silly.  We're talking about, maybe, 20x20 pixels of screen.
Inherently I prefer raster because every easily available image
software I use, which boils down to mspaint 90% of the time and The
GiMP if I'm in a pinch and can only do the editing from Linux, deals
naturally with all the major forms of raster.  Vector graphics, I
feel, are for people who want to be idealists and purists on a small
scale or for people who properly need an image to scale to large size
while not being a large file.  I don't think we need to be tied down
to either of those positions for our icons.  But yes, I think you're
definitely right that we should only have one set of images that needs
to be maintained, rather than trying to maintain parallel versions of
the images in different formats.

>
> Meanwhile anyone at all who can download and install inkscape and run a
> one liner (which might be a 3 or 4 liner in DOS) can generate a full set
> of PNG icons for BT testing purposes, so on Ubuntu Linux in a bash shell:
>
>  sudo apt-get install inkscape
>  cd ~/bibletime-1.7 # Or wherever you keep your BT source tree
>  cd pics/icons
>  for i in *.svg ; do inkscape $i -e ${i/.svg/.png} ; done
>
> is all it takes; and that's easier than my emailing binary files around
> at all, and this approach "teaches people to fish" rather than just
> handing them a single meal... :)

Learning inkscape is something I'm more than willing to do in order to
cook my meals.  But I don't feel the need to learn how to do Batch
programming in Windows in order to catch my meals.  I am thoroughly
familiar enough with Bash programming to do the above, but I'm trying
to make this painless and seamless for a person to do in Windows.  I
don't think that asking average-Joe programmer to install inkscape on
Windows, have us alter our software to locate the inkscape binary to
use for conversions and then have to deal with maintaining that extra
step is worth the effort.  I think we either need to determine if
there is a problem with our SVG files and fix those, or move to a
raster format and support that instead, rather than deal with trying
to use SVG on Mac and Linux and stick with PNG on Windows - then we
have to check the SVGs, the conversion process, inkscape AND our PNG
files if something goes wrong.  One or the other - not converting back
and forth.

>
> Why don't you try this (or its Windows equivalent) and report your
> results back to the team?  If you get totally stuck, then and only then
> download http://computeroptions.net/bibletime-pngs.tar.gz and test with
> those instead.  Eeli can do the same, of course.

For my reasons stated above, I'll probably do this directly, so we can
find out if the issue is SVG support in XP or if the issue is
something else and then figure out how to rectify it.

>
>> If, indeed, there are problems with the SVG files, as has been
>> indicated by Gary and yourself, then perhaps running the png files in
>> there would alleviate those warning messages as well as give us
>> rendering on Windows.
>
> It very likely would; but that's a side-effect of using PNG files, not a
> design goal!  The missing or corrupted linearGradient information in
> some of the SVG files may be causing imperfections in the displayed
> graphics.  The right fix for those warnings is surely to have the team
> graphics guru (I have no idea who originally created or edited these
> icons!) check and correct the actual SVG files, and *then* the build
> process can automatically create PNG raster files from the corrected
> vector graphics files.  Then cmake could set things up and run makensis
> to create a pretty little Windows BT installer .exe file which includes
> and installs those PNGs, for instance!

I'd rather not have to put in the complication of locating inkscape
and trying to make a batch conversion script in the CMake just for
Windows if it ends up that we have to use PNG files.  And as for the
single-step build process, I don't think that's at all feasible in
Windows, for reasons enumerated in a different e-mail where the topic
comes up again.

In short, I think we need to figure out how to get them displayed on
XP -- either fix the SVG files or change to PNG format - and then
choose that as the method for display for all systems.  I'd prefer to
stay with SVG if the problem is just that they need fixing.  That
definitely seems preferable to me, since we already have the SVG
support and those files are maintained.  However, if it proves
infeasible, then it might be time to revisit going with a different
format.

--Greg



More information about the bt-devel mailing list