You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by ra...@audiofarm.de on 2003/08/21 15:53:06 UTC

ImageTranscoder & Clip-Paths

I do have multiple SVG menu buttons like:

<svg id="Button_1">
 <path clip-path="url(#BackgroundClipPath)" d="..."/>
</svg>

<svg id="Button_2">
 <path clip-path="url(#BackgroundClipPath)" d="..."/>
</svg>

etc.

where 'BackgroundClipPath' is quite a round-shaped menu background. 

When viewing those buttons in Adobe's Viewer their edges appear smooth
as expected. However, when I start rendering those buttons as
BufferedImages (ARGB) using Batik's ImageTranscoder they come out with a
hard edge. It seems like they don't render to ARGB but to RGB images.
Other SVG graphics which don't employ a clip-path don't exhibit this
behaviour.

Anybody else had this problem?

ralf ...

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


Re: ImageTranscoder & Clip-Paths

Posted by Ralf Siegel <ra...@audiofarm.de>.
>
>     For performance reasons Batik uses hard-edged clip paths by default.
>You can fairly easily replace the clip-path references with mask refereces
>which Batik will render using anti-aliasing.  Also I believe if you
>set shape-rendering="geometricPrecision" Batik will use soft edge clipping.

That's what I thought, but for some reason the shape-rendering-attribute 
didn't have influence on the rendering result. However, masking works fine, 
though I just stumbled across yet another problem (more SVG related, less 
Batik)

Thanks again for your quick help Thomas!

ralf ...


-------------------------------------------------------------
Ralf Siegel - Freelance Developer
Recommended Site & Listening: http://forgetcassettes.com
contact_site: mailto:ralf@audiofarm.de
-------------------------------------------------------------



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


Re: ImageTranscoder & Clip-Paths

Posted by Thomas DeWeese <Th...@Kodak.com>.
ralf@audiofarm.de wrote:
> I do have multiple SVG menu buttons like:
> 
> <svg id="Button_1">
>  <path clip-path="url(#BackgroundClipPath)" d="..."/>
> </svg>
> 
> <svg id="Button_2">
>  <path clip-path="url(#BackgroundClipPath)" d="..."/>
> </svg>
> 
> etc.
> 
> where 'BackgroundClipPath' is quite a round-shaped menu background. 
> 
> When viewing those buttons in Adobe's Viewer their edges appear smooth
> as expected. However, when I start rendering those buttons as
> BufferedImages (ARGB) using Batik's ImageTranscoder they come out with a
> hard edge. It seems like they don't render to ARGB but to RGB images.
> Other SVG graphics which don't employ a clip-path don't exhibit this
> behaviour.
> 
> Anybody else had this problem?

     For performance reasons Batik uses hard-edged clip paths by default.
You can fairly easily replace the clip-path references with mask refereces
which Batik will render using anti-aliasing.  Also I believe if you
set shape-rendering="geometricPrecision" Batik will use soft edge clipping.



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