Hi everyone
I've been using Inkscape for about a year now and it's grown into a great product.
I'm no designer or graphic artist... more of an enthusiast in web development and standards, but I do produce various images/logos in vector format. All done with Inkscape these days.
I'm currently working on an intranet application (PHP/MySQL) which stores company/contact information for a small local publishing house.
They deal with many companies and are constantly losing vector versions of all the logos they deal with.
So what I wanted to do was store their logos in the MySQL database... basically have a field in the DB which stores the raw SVG XML content. Easy, and highly compressible!
I've messsed around with exporting Adobe Illustrator vector (.ai / .eps) files to SVG and opening them in Inkscape. It all seems to work fine, but the file sizes tend to be much larger than an equivalent file made with Inkscape alone.
When I open the SVG in a text editor, I can instantly see what makes the file size so big.
It seems as if Illustrator saves a 'preview' raster version of the image within the SVG file.
It all seems to be contained within an XML branch called <xap:Thumbnails>
Here's my questions:
1) I don't want those preview images/thumbnails as they would take up a massive amount of space in my database.
Would it be ok to just remove that entire <xap:Thumbnails> branch in the XML?
Or will that screw the SVG up and mean I'm unable to edit it in Inkscape/Illustrator in the future?
2) Is there any other Illustrator-specific stuff that would be safe to remove from the SVG file?
In my few tests, it seems there's loads of references to adobe illustrator XML namespaces and stuff.
3) When I open up an Illustrator SVG in Inkscape, it looks perfect. But when I go to Save As and try and save over the file as an Inkscape SVG, I still get the <xap:Thumbnails> branch persisting in the SVG document, and doubling the file size.
The way I've found to stop that happening is to copy the image/shapes, and paste into a fresh blank Inkscape document and save as a new Inkscape SVG file.
I will be exporting thousands of .ai files to .svg using Illustrator
But I don't really want to then have to open them in Inkscape, and copy each to a new Inkscape document to get valid Inkscape SVG. Is there a way that Inkscape can just remove that by just hitting 'save' or save as over the existing file?
Also what I was thinking was telling a PHP script to remove the <xap:Thumbnails> XML branch automatically from the SVG when the user pastes the code into my script.
But I'd also like to know if there's any other Illustrator nonsense that's worth removing from my SVG?
Thanks, B
[solved] SVG conversion from illustrator -> inkscape. Remove
Re: SVG conversion from illustrator -> inkscape. Remove preview?
There's an Inkscape import option called "Adobe Illustrator SVG (*.ai.svg)", with the description "Cleans the cruft out of Adobe Illustrator SVGs before opening". Sounds like this does what you want, but I haven't got any Illustrator SVG files to test it on.
Re: SVG conversion from illustrator -> inkscape. Remove preview?
Wow that sounds perfect!
Though when I save as SVG out of Illustrator CS 11, it gets named as just .svg
Not .ai.svg, which the Inkscape import filter seems to expect.
If I try and rename my SCG to .ai.svg, and import in Inkscape (0.45), I get an error message... "Failed to load the requested file..."
Though when I save as SVG out of Illustrator CS 11, it gets named as just .svg
Not .ai.svg, which the Inkscape import filter seems to expect.
If I try and rename my SCG to .ai.svg, and import in Inkscape (0.45), I get an error message... "Failed to load the requested file..."
Re: SVG conversion from illustrator -> inkscape. Remove preview?
I don't know why the Illustrator SVG import filter doesn't work. But I notice that it uses an XSLT file, unlike any of the other import filters in Inkscape 0.45. So you could presumably use the XSLT file (aisvg.xslt in the Inkscape extensions directory) with a stand-alone XSLT processor to strip out the Illustrator-specific stuff. That would also mean that you could process Illustrator SVG files en masse.
But if you want to use Inkscape, can't you just open the Illustator SVG files in Inkscape as normal, and then save as Plain SVG?
But if you want to use Inkscape, can't you just open the Illustator SVG files in Inkscape as normal, and then save as Plain SVG?
Re: SVG conversion from illustrator -> inkscape. Remove preview?
Ok cool
I think tried that by copying the Illustrator SVG into a blank Inkscape document.
Then saved the document as an Inkscape SVG
Then saved that as a plain SVG and got a warning, saying something like "You will lose data" if I continued.
I don't want to lose data - well I do, I want to 'streamline' my SVG to the specs. But not at the expense of losing, say, a black border round something and only finding out about it a year later by accident.
I don't mind having the Inkscape extras stuff in my SVG, as I trust Inkscape to only have in there what's necessary or advisable.
I can't say the same about Adobe though
I'll play around with the plain SVG and let you know what happens
I think tried that by copying the Illustrator SVG into a blank Inkscape document.
Then saved the document as an Inkscape SVG
Then saved that as a plain SVG and got a warning, saying something like "You will lose data" if I continued.
I don't want to lose data - well I do, I want to 'streamline' my SVG to the specs. But not at the expense of losing, say, a black border round something and only finding out about it a year later by accident.
I don't mind having the Inkscape extras stuff in my SVG, as I trust Inkscape to only have in there what's necessary or advisable.
I can't say the same about Adobe though
I'll play around with the plain SVG and let you know what happens
Re: SVG conversion from illustrator -> inkscape. Remove preview?
Saving as plain SVG should safe - the tags that will be removed don't describe the drawing, they just describe how Inkscape can manipulate the drawing. They are the tags that non-Inkscape software ignore.
Also, I would have expected Illustrator to have an option to not include a preview in the SVG file. I know you can on most other formats so you might like to check.
Also, I would have expected Illustrator to have an option to not include a preview in the SVG file. I know you can on most other formats so you might like to check.
Re: SVG conversion from illustrator -> inkscape. Remove preview?
Tried saving out of Illustrator as SVG and messed around with the various options and it seems there's no way to get rid of the illustrator stuff - at least in the version I was using (v11 CS1)
But saving that out of Inkscape as a plain SVG seems to preserve everything ok, so that will probably be the option I'll go for.
Then just copy & paste the source code into my database fields
Then whenever any of the users needs a vector version of that company's logo, they just download the SVG from the database and do whatever they want with it.
Thanks for all your help guys, B
But saving that out of Inkscape as a plain SVG seems to preserve everything ok, so that will probably be the option I'll go for.
Then just copy & paste the source code into my database fields
Then whenever any of the users needs a vector version of that company's logo, they just download the SVG from the database and do whatever they want with it.
Thanks for all your help guys, B
Re: SVG conversion from illustrator -> inkscape. Remove preview?
batfastad wrote:Tried saving out of Illustrator as SVG and messed around with the various options and it seems there's no way to get rid of the illustrator stuff - at least in the version I was using (v11 CS1)
But it appears to be possible to save SVG files with hardly any Illustrator cruft in Illustrator 12 and 13, as there's someone who posts a lot of these on the Open Clip Art Library site.
But saving that out of Inkscape as a plain SVG seems to preserve everything ok, so that will probably be the option I'll go for.
Did you try opening the plain SVG file in Illustrator? Having now taken a look at an Illustrator SVG file (of the bloated kind), I think the stripped file may appear blank when viewed in Illustrator. But I might be wrong, as I can't try it out.
Re: SVG conversion from illustrator -> inkscape. Remove preview?
Just tried a few tests of opening plain SVGs back into Illustrator and everything seems to be ok.
I've checked stroke widths and editability and everything seems to be ok.
So I reckon I'll go with this as a plan and start storing the logos in SVG code in the database.
Obviously we'll keep all the old .ai and .eps files and see how they get on with this SVG format.
The only problem with this is that they still use Quark 6.5 which has no SVG support.
Though they're planning to do some upgrades and move over to InDesign so I'm guessing the later versions of InDesign will be able to import SVGs into picture boxes etc.
One final question about the SVG format in general, what about colours?
Obviously in a press/production environment most of the logos use CMYK colour models - will that get affected by saving from Illustrator to SVG, then Inkscape to plain SVG?
Are they all converted to RGB within the SVG format, or will the colour information remain accurate?
Thanks, B
I've checked stroke widths and editability and everything seems to be ok.
So I reckon I'll go with this as a plan and start storing the logos in SVG code in the database.
Obviously we'll keep all the old .ai and .eps files and see how they get on with this SVG format.
The only problem with this is that they still use Quark 6.5 which has no SVG support.
Though they're planning to do some upgrades and move over to InDesign so I'm guessing the later versions of InDesign will be able to import SVGs into picture boxes etc.
One final question about the SVG format in general, what about colours?
Obviously in a press/production environment most of the logos use CMYK colour models - will that get affected by saving from Illustrator to SVG, then Inkscape to plain SVG?
Are they all converted to RGB within the SVG format, or will the colour information remain accurate?
Thanks, B
Re: SVG conversion from illustrator -> inkscape. Remove preview?
SVG files are RGB, but it's possible for them to have an ICC profile, which could correspond to a CMYK colour space (though I'm not sure how this works, and I've never seen an SVG file with an ICC profile in practice).