Hi Thomas,

We cannot control how the SVGs that we show are created.

I think it would be a good idea to have a way to control the rendering hits for the transcoder. We might implement a adaptive algorithm for switching antialiasing on and off, depending on the size and content of the image.

So if you re-factored the imagetranscoder interface so that the render is created by calling at method that I can override, I can just call super and add the rendering hints to the render at that point to the returned renderer. E.g. move this

        // paint the SVG document using the bridge package
        // create the appropriate renderer
ImageRendererFactory rendFactory = new ConcreteImageRendererFactory(); // ImageRenderer renderer = rendFactory.createDynamicImageRenderer(); ImageRenderer renderer = rendFactory.createStaticImageRenderer();

to a method called something like createRenderer like this

        public ImageRenderer createRenderer()
        {
                // create the appropriate renderer
ImageRendererFactory rendFactory = new ConcreteImageRendererFactory(); // ImageRenderer renderer = rendFactory.createDynamicImageRenderer(); ImageRenderer renderer = rendFactory.createStaticImageRenderer();

                return renderer;
        }

 That would work perfectly for us.

Best Regards,
Per Jessen Schmidt

YaWah.com ApS
Egå Havvej 25 c
DK-8250 Egå
Phone:          +45 7026 2515
Phone direct:   +45 4029 9901
Fax:                    +45 8749 0515
This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.





On 23/04/2007, at 15.36, [EMAIL PROTECTED] wrote:

Hi Per,

Per Jessen Schmidt <[EMAIL PROTECTED]> wrote on 04/23/2007 03:18:03 AM:

I have a problem with antialiasing when rendering to small images,
particular on the Mac. When creating small thumbnail sized images
with thin lines, the image can be very "dim", on the Mac they
almost disappear. The problem is that I cannot override the Render
default rendering hints. The image transcoder's transcode method
create the render with the default rendering hints, and I cannot
find a method to change this without changing the source code.

   Why don't you add 'shape-rendering="crispEdges"' to the root
of the document being rendered?

I have my own transcoder that override the createImage and
writeImage methods. The reason for this is that we render SVG on the
server side sometimes on top of an existing image, sometimes on a clean
image.

My questions are: does anyone have the same problem? And do anyone
have a solution where you can override the default rendering hints
on the render, when calling the transcode method, without changing
the Batik code?

   If it helps I could add a 'createRenderer' method that you could
override.

I have attached an example. A small SVG file rendered in 110 x 60
pixel, on a PC and on a Mac with the default hints, and one rendered
on the Mac where I have changed the Batik code to not use the anti
aliasing rendering hint.

PS. Yes there are three images the one Mac one look empty, but crank
up the contrast in Photoshop an there are image information :-)

Best Regards,
Per Jessen Schmidt

YaWah.com ApS
Egå Havvej 25 c
DK-8250 Egå
Phone: +45 7026 2515
Phone direct: +45 4029 9901
Fax: +45 8749 0515
This email message is for the sole use of the intended recipient(s)
and may contain confidential and privileged information. Any
unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.

[image removed]
[image removed]
[image removed]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: batik-users- [EMAIL PROTECTED]


Reply via email to