The Questions

I have an application that generates a tag cloud with XHTML+CSS. This is all fine and dandy but I now need to be able to render this same tag cloud as an image.

At a pinch, I could probably render the cloud in SVG+CSS and then find a utility to convert this to JPEG, but would this be making unnecessary work for myself? Are there better methods?

The one thing I want to avoid is having to start creating graphics from first principles - I'm looking for quick'n'easy here, so any suggestions would be appreciated!

The Conclusions

Many thanks to those who have responded to this post. It appears to me that SVG is the way to start and Inkscape may be the way to continue. The main thing is to get the SVG part sorted - that's the bulk of the work for me. Then it's a case of testing various conversions from SVG to PNG, or whatever. (Thanks for the tip to avoid JPEG. I'll still use JPEG as an optional end-product because I'll be stuffing it with EXIF metadata which can be viewed when posted to Flickr.)

Unfortunately, tools like GtkMozEmbed are out of the question for web apps due to the server load. As it is, I will probably put the SVG->PNG rendering into a queue to even load rather than displaying it instantly.


In reply to Path of least resistance to JPEGs by smiffy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.