xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: Effect of shape-rendering property
Date Fri, 10 Nov 2006 11:38:51 GMT
Hi Stephen,

Stephen Drake <steve@drakenz.com> wrote on 11/09/2006 02:03:12 AM:

> Thanks for your help - I have had some success now in displaying
> smooth-edged, rotated images with several of the methods described.

   Glad to help (if I did ;).

> thomas.deweese wrote:
> > 
> >    So the image is broken into tiles, but they are aligned properly. I
> > suspect that the anti-aliasing you see on Mac OS X is causing the
> > tile edges to be visible even when they shouldn't be.
> > 
> Indeed - I displayed each tile scaled up in a separate window, and it 
> clear that they were anti-aliased along the top and left edges.  I think
> I've seen this behaviour on the Mac before.  One way around it is to 
> the clip area as in the patch below:

   Hmm, I wonder if we can eliminate the clip completely.  It's
introduced in the 'GraphicsUtil.createGraphics'  We used to use
this so we could calculate the size of the output rendering buffer.
I think most of that has moved to using 'getDestination'/

> This stops the tile edges from showing in clip and mask operations. 

    Thanks for tracking this down, I'll try at least outsetting 
the clip for Mac.

> I guess this kind of thing is also what causes lines to appear
> sometimes when a dynamic document is updated on the Mac.


> thomas.deweese wrote:
> > 
> >    Another method to try would be to put the image with the mask in
> > a pattern and fill a rotated rect with that.  You might not even need
> > to mask the image in this case.
> > 
> This works perfectly wrt shape rendering (no mask required), but on the 
> the image is blocky - it looks like it is rendered at the size of the
> pattern and then scaled up.

   Hmm, this would be very odd.  I have a hard time imagining what
would cause that.

> I wrote in my original post:
> > ii)  Apply a mask to the image.  This looks great on Windows and 
> > but on OS X ... it looks like gradients that would smooth the edge out 
> > been applied the wrong way around, mirrored.

> This problem appears to arise when the mask is converted to a luminance
> colorspace using Any2LumRed.  I have attached a patch below which works 
> me on Mac, Windows and Linux, all with various revisions of Java 1.5. 
> source code mentions a bug in ColorConvertOp, and my patch attempts to
> remove the workaround for that bug.

   You go a little bit too far though.  The divide out of alpha is
important, It's the middle part of your patch (the construction of
destBI) that can safely be skipped (as well as the copyBand at the 
end), the coerceData calls are still needed I think.

> I don't know the history though, so I can't tell if the bug has 
> been fixed in a subsequent Java release or if it applies to a 
> situation other than what I am testing.

   Once again thanks for the time to track this stuff down!

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

View raw message