Hi Pepping,

"Pepping, Florian" <[EMAIL PROTECTED]> wrote on 
01/08/2007 09:47:25 AM:

> I described the situation in a wrong way. The SVGs are rendered with
> 32 bits per pixel but the display hardware (the monitor) supports 
> only 16 bits per pixel. Sorry for this.
> 
> Ok, I think dithering is the right way. However can it be realized 
> with SVG and Batik? I didn't find a proper way.

   It could be (in fact I'm fairly sure that you will get
dithering (simple pattern dither) if Batik draws directly 
to a 16bpp screen due to Java2D).  If this is what you are
doing you might look at Setting the RenderingHints.KEY_DITHERING
to VALUE_DITHER_ENABLE before having the JSVGCanvas draw to
your screen (I'd do this by subclassing the JSVGCanvas and
overriding paintComponent so it set's this hint on the
Graphics then calls super.paintComponent).

   However, in this case since I suspect you just want to take 
a 32bpp PNG file and convert it to 16bpp PNG, I would suggest 
using something like Gimp to do this (if you have options
try 'error diffusion' or 'Floyed-Steinberg' (sp?)).

> If not I will change my graphics and use another effect to prettify 
> the start-graphic of my app.
> 
> Thanks Florian
> 
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Monday, January 08, 2007 2:02 PM
> To: [email protected]
> Cc: [email protected]
> Subject: Re: Concentric circles using radial gradients

> 
> Hi Florian, 
> 
> "Pepping, Florian" <[EMAIL PROTECTED]> wrote on 
> 01/08/2007 07:40:17 AM:
> 
> > Displaying SVGs like the example I attached and zooming in, there are
> > annoying concentric circles with different colors. That looks bad when
> > displaying greater areas.
> 
> > I know it's a problem of the bitnumber per pixel. Using 32 bit per 
pixel
> > everything looks fine but using 16 bits the concentric circles are
> > visible. However the hardware the SVG-Files are rendered only supports
> > 16 bits per pixel.
> 
>     This statement strikes me as a little odd, since Batik always 
renders 
> images at 32 bits per pixel.  How are you rendering to 16 bits per 
pixel? 
> 
>     One option is to use dithering when going from 32->16 bits per 
pixel. 
> This will adjust the color mapping spatially so that you don't end up 
> with as much banding. 
> 
> > Has anyone of you an idea how to overcome these concentric circles?
> > Perhaps using anti-aliasing, radial transparency (if such exists) or
> > something else.
> 
>    Batik actually implements anti-aliased gradients 
> (set color-rendering="optimizeQuality" on the element being filled), 
> but this won't help in this case.  You need some form of dithering 
> to help out here. 

Reply via email to