Image rendering problem from SVG
"Chris Miles" <[email protected]>
| Newsgroups | gmane.text.xml.batik.user |
|---|---|
| Message-ID | <[email protected]> |
Good Evening,
I have an SVG which I have created (attached) which looks fine if I open it,
but when I render it to JPG or PNG the quality looks pretty awful and the
layers seems to be messed up.
PNGTranscoder t = new PNGTranscoder();
t.addTranscodingHint(PNGTranscoder.KEY_WIDTH, this.imageWidth);
t.addTranscodingHint(PNGTranscoder.KEY_HEIGHT, new Float(height));
TranscoderInput input = new TranscoderInput(doc);
TranscoderOutput output = new TranscoderOutput(ostream);
t.transcode(input, output);
or
JPEGTranscoder t = new JPEGTranscoder();
t.addTranscodingHint(JPEGTranscoder.KEY_QUALITY, new Float(1.0));
t.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, this.imageWidth);
t.addTranscodingHint(JPEGTranscoder.KEY_HEIGHT, new Float(height));
TranscoderInput input = new TranscoderInput(doc);
TranscoderOutput output = new TranscoderOutput(ostream);
t.transcode(input, output);
I then pass the output to the browser as image data. I have attached the
poor quality image result.
I hope someone can shed some light on this. Many Thanks..
Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
test1.svg
(image/svg+xml, 61.2 KB) - not displayed
poorquality.jpg
(image/jpeg, 33.5 KB) - not displayed