Re: Rendering precision
I'd say you should be able to achieve a similar similar result by tweaking the content to use the intended rendering properties [1] configured for quality. ;-) I didn't know about these and I am unable to find them in Inkscape after a quick check. I see their potential, but unless they are easy to set in drawing programs they are of no use. ... Could you raise a request for enhancement for the SVG Rasterizer in the bug tracker? Please include a link to this mailing list thread. This bookmark [2] should help if you have any difficulties! ;-) Done: https://issues.apache.org/bugzilla/show_bug.cgi?id=48702 Regards, Johan - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
Re: Rendering precision
Hi Johan, I had the same problem and couldn't find any quality settings. I did find a protected method of transcoders: createRenderer(), which returns an ImageRenderer. You can set Java2D rendering hints on this class. By creating a simple subclass you can tell the ImageRenderer to use the highest possible quality: [code snippet] Thanks for sharing! :-) I'd say you should be able to achieve a similar similar result by tweaking the content to use the intended rendering properties [1] configured for quality. ;-) Nevertheless, it sounds interesting to be able to set a rendering hint in order to force different quality settings: * highest (for printing/perfection); * lowest (for performance/reduce memory consumption) . I'd say this was interesting to see in the framework. (Unless I'm missing something and this is possibly already covered...) Could you raise a request for enhancement for the SVG Rasterizer in the bug tracker? Please include a link to this mailing list thread. This bookmark [2] should help if you have any difficulties! ;-) The provided code snippet is pretty similar to what's already being done in the transcoder classes, so I'd even invite you to rehearse a patch! :-) Regards, Johan Cheers, Helder [1] http://www.w3.org/TR/SVG/painting.html#RenderingProperties [2] https://issues.apache.org/bugzilla/enter_bug.cgi?bug_file_loc=http%3A%2F%2Fold.nabble.com%2FRendering-precision-td27459379.htmlbug_severity=enhancementcomponent=SVG%20Rasterizerform_name=enter_bugop_sys=Allpriority=P4product=Batikrep_platform=PCtarget_milestone=---version=1.8 - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
RE: Rendering precision
Hi Johan, I had the same problem and couldn't find any quality settings. I did find a protected method of transcoders: createRenderer(), which returns an ImageRenderer. You can set Java2D rendering hints on this class. By creating a simple subclass you can tell the ImageRenderer to use the highest possible quality: PNGTranscoder t = new PNGTranscoder() { @Override protected ImageRenderer createRenderer() { ImageRenderer r = super.createRenderer(); RenderingHints rh = r.getRenderingHints(); rh.add(new RenderingHints(...); ... ... r.setRenderingHints(rh); return r; } }; thanks for this quick and valuable response! Now circles are realy circles ;-) I raise my hat to you. Regards, Jan - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
Re: Rendering precision
Hi Jan, I had the same problem and couldn't find any quality settings. I did find a protected method of transcoders: createRenderer(), which returns an ImageRenderer. You can set Java2D rendering hints on this class. By creating a simple subclass you can tell the ImageRenderer to use the highest possible quality: PNGTranscoder t = new PNGTranscoder() { @Override protected ImageRenderer createRenderer() { ImageRenderer r = super.createRenderer(); RenderingHints rh = r.getRenderingHints(); rh.add(new RenderingHints(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_QUALITY)); rh.add(new RenderingHints(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC)); rh.add(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); rh.add(new RenderingHints(RenderingHints.KEY_COLOR_RENDERING, RenderingHints.VALUE_COLOR_RENDER_QUALITY)); rh.add(new RenderingHints(RenderingHints.KEY_DITHERING, RenderingHints.VALUE_DITHER_DISABLE)); rh.add(new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY)); rh.add(new RenderingHints(RenderingHints.KEY_STROKE_CONTROL, RenderingHints.VALUE_STROKE_PURE)); rh.add(new RenderingHints(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON)); rh.add(new RenderingHints(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF)); r.setRenderingHints(rh); return r; } }; Regards, Johan - To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org