import-bot (20212) [Avatar] Offline
#1
[Originally posted by jbdenis]

Dear Mr. Verbruggen,

I indeed enjoyed reading your book some weeks ago and was able to produce some
correct jpeg files starting with the examples provided.

Thanks for your clear and pragmatic presentation of complicated matters.

Among other things, my aim was to produce some flow diagrams to include in my
writings (latex, html or even "doc"). And I must say that I was quite
desappointed by the bad quality of the text outputs, even with "eps" format.
For this reason, I started to produce svg files using the "Svg" perl module.
Results are much better, but now I have the problem to translate a svg file
into a standard format to include it in my documents. I saw on the web a
"svg2png" program but was not able to get it.

Questions :
(1) is there some way to improve the quality of ImageMagick outputs
concerning "bitmap" formats like jpeg or png for letters?
(2) do you know easy ways to translate "svg" format in jpeg/png files?

I can use MSWindows or Linux but I prefer the later.

Thanks again for your work, incidentally reading the book I improved my Perl
(easy task I must admit).

JBD
import-bot (20212) [Avatar] Offline
#2
Re: creating flow diagrams
[Originally posted by mgjv]


> Dear Mr. Verbruggen,
>
> I indeed enjoyed reading your book some weeks ago and was able to produce some
> correct jpeg files starting with the examples provided.
>
> Thanks for your clear and pragmatic presentation of complicated matters.

Thank you. I am glad you find it useful.

> Among other things, my aim was to produce some flow diagrams to include in my
> writings (latex, html or even "doc"smilie. And I must say that I was quite
> desappointed by the bad quality of the text outputs, even with "eps" format.
> For this reason, I started to produce svg files using the "Svg" perl module.
> Results are much better, but now I have the problem to translate a svg file
> into a standard format to include it in my documents. I saw on the web a
> "svg2png" program but was not able to get it.

SVG is (mainly) a line art format, meaning that it doesn't store the rendered
pixels, but instead instructions about what needs to be drawn. LaTeX and Word
are perfectly capable of using line art formats. In the case of LaTeX, it
would normally be EPS, or maybe PDF, if you output to PDF, and in the case of
Word, there are several supported formats.

If you run line art through Image::Magick, it will render it. IM is a bitmap
oriented package, and will only work with bitmaps. On input, any line art is
rendered into a bitmap, and output is always a bitmap.

> Questions :
> (1) is there some way to improve the quality of ImageMagick outputs
> concerning "bitmap" formats like jpeg or png for letters?

The best way I can think of would be to render the image at the correct size
and resolution for your output format. Rescaling and resizing will always
diminish the quality of a bitmap. You would probably need to set up the
resolution and size before reading in the SVG file.

> (2) do you know easy ways to translate "svg" format in jpeg/png files?

From my experience, Image::Magick does quite a good job. Some of the images in
the book have been rendered by Image::Magick from SVG input files, like the
clock in the appendix. I do make sure that the SVG file contains the sizing
information that is needed for the output bitmap.

If you render these images, and subsequently resize them (especially if you do
this in Word or inside of LaTeX), the result can be much less than desirable.
Off the top of my head, I don't know of anything else, but then, I haven't
needed anything else yet smilie

> I can use MSWindows or Linux but I prefer the later.

So do I smilie

On Linux, you could use the convert command that comes with ImageMagick
directly, without the need to use Perl.

Martien