Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: SVG to Raster

  1. #1
    Guild Member Jeff_Wilson63's Avatar
    Join Date
    Sep 2009
    Location
    Fort Collins, Colorado, USA
    Posts
    78

    Post SVG to Raster

    I'm loving svg. Unfortunately svg images can't be read by IE or posted to this forum so I need something to change svg into a raster image. Because of what I want to do, I'd prefer an application that will automatically handle linked svg files.

    My searches have turned up Apache Batik. Does anyone have experience with this program and know whether it handles linked svg files?

    Failing Batik, does anyone know of another product that can import linked svg files (Inkscape and GIMP don't, by the way) and export a raster image?

    As last recourse I can write a php program to bring the files together so Inkscape or GIMP can read them, but that seems file bloat to no real purpose, so I'd prefer to avoid it.
    http://www.monticello21st.com/rpg/nfwiki/
    Call the Lightning. Ride the Storm. Find your Power. Become Reborn.
    Seek your Place, and know it well. Live a tale you wish to tell.

  2. #2
    Community Leader Facebook Connected torstan's Avatar
    Join Date
    Jul 2007
    Posts
    4,199

    Post

    Imagemagick should be able to do it:

    convert test.svg test.png

    should work? It certainly says that it can handle svg.

  3. #3
    Administrator Redrobes's Avatar
    Join Date
    Dec 2007
    Location
    England
    Posts
    7,187
    Blog Entries
    8

    Post

    Yes I believe IM can do it. But hold on a mo. Why not use Firefox, Opera, IE, or Safari ? I was under the impression that proper web browsers could view them directly.

    Now theres something wrong with that line...Oh yes... proper web browsers. Yeah so Firefox, Opera, or Safari - try any of them and it ought to display.

  4. #4
    Guild Member Jeff_Wilson63's Avatar
    Join Date
    Sep 2009
    Location
    Fort Collins, Colorado, USA
    Posts
    78

    Post

    Quote Originally Posted by Redrobes View Post
    so Firefox, Opera, or Safari - try any of them and it ought to display.
    Yep. I'm using Firefox to test my images, and when I rewrite my pages I'll use svg directly. However, you can't post svg images to this forum. Since I'll need the conversion to post to this forum anyway, I might was well set things up to allow IE users to view svg images I want to show.

    Another factor is the several hundred png files that already exist vs. the couple of thousand references to those files. Replacing the png's may be easier than rewriting the web pages to use svg files. (Though the rewrite will still need to be done eventually I know.)
    http://www.monticello21st.com/rpg/nfwiki/
    Call the Lightning. Ride the Storm. Find your Power. Become Reborn.
    Seek your Place, and know it well. Live a tale you wish to tell.

  5. #5

    Default

    Inkscape handles linked SVG files just fine... it just doesn't provide a friendly interface for creating the links. So if you already have a bunch of SVG files that just need converted, Inkscape should handle that. If you want to create new SVG files, you can do it with Inkscape, but you have to edit the links in the XML editor by hand. Kind of a pain if you're wanting to do a bunch of map symbols or something.

    For map symbols, it turned out to be more beneficial to build my library of SVG symbols and write a script to convert them all to PNGs to use in my maps. That way, Inkscape doesn't have to re-render the blurs on all the imported objects, which speeds up the display considerably.

  6. #6
    Guild Member Jeff_Wilson63's Avatar
    Join Date
    Sep 2009
    Location
    Fort Collins, Colorado, USA
    Posts
    78

    Post

    Quote Originally Posted by ravenx99 View Post
    Inkscape handles linked SVG files just fine... it just doesn't provide a friendly interface for creating the links. So if you already have a bunch of SVG files that just need converted, Inkscape should handle that. If you want to create new SVG files, you can do it with Inkscape, but you have to edit the links in the XML editor by hand. Kind of a pain if you're wanting to do a bunch of map symbols or something.
    Er, what? This doesn't match what Inkscape does at all.

    http://www.monticello21st.com/glyphica/GlySymList.svg loads fine in both Inkscape and Firefox because there are no linked files. http://www.monticello21st.com/glyphica/GlyGrpList.svg displays just fine in Firefox, but displays an empy box on loading in Inkscape. The only syntactical difference between the two files is that the second uses linked files and first doesn't.

    I have no need to use Inkscape's built-in XML editor as the link data is already included in the files I'm trying to convert.
    http://www.monticello21st.com/rpg/nfwiki/
    Call the Lightning. Ride the Storm. Find your Power. Become Reborn.
    Seek your Place, and know it well. Live a tale you wish to tell.

  7. #7
    Software Dev/Rep Hai-Etlik's Avatar
    Join Date
    May 2009
    Location
    48° 28′ N 123° 8′ W
    Posts
    1,333
    Blog Entries
    1

    Post

    I think there's some confusion in terminology. The OP seems to be using "link" to mean use elements with external references. Other people are interpreting it as the use element in general, or as hyperlinks.

    Inkscape supports the use element with references to internally defined elements.

    Firefox supports the use element with references to externally defined elements.

    Inkscape has a fairly basic interface for creating hyperlinks from elements. It doesn't provide any mechanism for following them.

    Firefox supports following such hyperlinks the same way it does HTML hyperlinks.

  8. #8
    Guild Member Jeff_Wilson63's Avatar
    Join Date
    Sep 2009
    Location
    Fort Collins, Colorado, USA
    Posts
    78

    Post

    Yes. Thank you.

    I need a graphics convertor that will handle svg files which use externally defined elements.

    I do use <map><area> in html code to define image maps and hadn't considered actually putting those commands (or the xml equivalent) into the svg file itself to create hyperlinks. I'll have to look at that when I reach that point.
    http://www.monticello21st.com/rpg/nfwiki/
    Call the Lightning. Ride the Storm. Find your Power. Become Reborn.
    Seek your Place, and know it well. Live a tale you wish to tell.

  9. #9

    Post

    Quote Originally Posted by Jeff_Wilson63 View Post
    Er, what? This doesn't match what Inkscape does at all.
    Er, just trying to help.

    Inkscape does exactly what I said it does... it includes and renders linked SVG files. But it doesn't support referencing individual objects inside the file with ID #anchors, which is what your sample file requires. That is, Inkscape can use "image xlink:href=file" to include an SVG file, but it can't do "use xlink:href=file#id" to reference specific objects.

    So Inkscape does what you said it can't. But what you said it can't do isn't what you needed it to do. So stop looking at me like I'm smoking an illegal substance.

    Too bad Inkscape doesn't support this... it'd be a nice feature for maintaining symbol libraries. I have to keep a separate SVG file for each map symbol.

  10. #10
    Guild Member Jeff_Wilson63's Avatar
    Join Date
    Sep 2009
    Location
    Fort Collins, Colorado, USA
    Posts
    78

    Post

    Quote Originally Posted by ravenx99 View Post
    That is, Inkscape can use "image xlink:href=file" to include an SVG file, but it can't do "use xlink:href=file#id" to reference specific objects.
    OK. I see how this works now. Thanks for the information.

    After some thought it's still easier for me to use php to generate temporary files than to break my existing files down to their separate symbols. I'll post if I find any alternatives.
    http://www.monticello21st.com/rpg/nfwiki/
    Call the Lightning. Ride the Storm. Find your Power. Become Reborn.
    Seek your Place, and know it well. Live a tale you wish to tell.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •