You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by "simon steiner (JIRA)" <ji...@apache.org> on 2017/09/19 10:25:00 UTC

[jira] [Commented] (BATIK-1180) SVG to PNG Convertion

    [ https://issues.apache.org/jira/browse/BATIK-1180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16171479#comment-16171479 ] 

simon steiner commented on BATIK-1180:
--------------------------------------

Output look good on trunk

> SVG to PNG Convertion
> ---------------------
>
>                 Key: BATIK-1180
>                 URL: https://issues.apache.org/jira/browse/BATIK-1180
>             Project: Batik
>          Issue Type: Bug
>          Components: SVG DOM
>    Affects Versions: 1.7, 1.8
>         Environment: Java
>            Reporter: balaji
>            Priority: Critical
>         Attachments: 1489143870027 - Copy - Copy.svg, 1489143870027.png
>
>
> Created SVG object . When I open directly that svg in browser looks good. 
> When I Convert this to PNG clarity was gone. 
> Attached both SVG and generated PNG.
> Appreciate for early response 
> Sample Code what we are using
> svg_URI_input = new File(filePath + fileNameWithoutExt + ".svg").toURL().toString();
> 			TranscoderInput input_svg_image = new TranscoderInput(svg_URI_input);
> 			OutputStream png_ostream = new FileOutputStream(filePath + fileName);
> 			TranscoderOutput output_png_image = new TranscoderOutput(png_ostream);
> 			PNGTranscoder my_converter = new PNGTranscoder();
> 			my_converter.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,	new Float(1.0));
> 			my_converter.addTranscodingHint(JPEGTranscoder.KEY_HEIGHT, 250f);
> 			my_converter.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, 1292f);
> 			
> 			// Write output
> 			my_converter.transcode(input_svg_image, output_png_image);
> 			// close / flush Output Stream
> 			png_ostream.flush();
> 			png_ostream.close();



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org