xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas E Deweese <thomas.dewe...@kodak.com>
Subject Re: What's absolute minimum requires for AWT Image generation?
Date Mon, 18 Mar 2002 13:43:38 GMT
>>>>> "JC" == Justin Couch <justin@vlc.com.au> writes:

      This is a bit thin on details that might let us really debug
your problem (like exactly what sort of buffered image you are using
and the SVG snippit you are rendering).

JC> Vincent Hardy wrote:

>> You are saying that you cannot get the background color right or
>> that you have 'other oddities': could you tell us specifically how
>> you are trying to set the background color and what the oddities
>> are?

JC> The simplest process is creating my own custom Image instance,
JC> with default background of all alpha. With this, I then use
JC> GraphicsUtil to create a Graphics2D instance, as recommended. From
JC> this, I then call GraphicsNode.paint() on a root instance of the
JC> document. No RenderingHints are set. Visual artifacts are the
JC> background colour is being reset (I'd like just to create a
JC> straight text string printed on an image) there's aliasing effects
JC> around the edge of the text. I think some of that is to do with
JC> the way I'm creating the image, but I'm not really sure yet.

JC> In this simplest of tests I'm trying to implement an X3D Text node
JC> which is described as a "Flat two-sided item". We don't need to
JC> create polygons, so as the first step is just a simple text string
JC> on a transparent image to run as a texture. Admittedly it would be
JC> far easier to not use SVG altogether, but this was supposed to be
JC> the first step in a much larger process for the integration. It's
JC> the "get to know you" step.

    Given the amount of information I have I suspect one of two things:

    1) Your 3D engine only does masking not alpha.  Since by default
       everything we draw is anti-aliased your text will have
       semi-transparent pixels all around the edges if the 3D engine
       converts this alpha channel to a mask some of these blended
       pixels will become opaque giving bad results if the background
       is something other than black (you don't say what color the
       text is in SVG or the background in 3D).

    2) You or the JDK is messing up the alpha premultiplied state.
       There are a number of bugs in the JDK (1.2, and 1.3 haven't
       tested 1.4 yet) where it tries to divide out alpha but doesn't.
       This can also cause commonly edge effects.

    If it is #1 (which is my bet) you will need to either tell the SVG
content to use 'crisp edges'/'gemetric precision' or tell Batik not to
anti-alias (RenderingHints).

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

View raw message