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 Kamal Bhatt <kb...@tt.com.au> on 2006/08/15 06:36:38 UTC
Using Batik to manipute images
Hi
I don't know if this is the right mailing list, but here it goes.
I would like to use batik through Cocoon to manipulate images, for
example, to bevel the corners of an image or cut the corners of the
image. For cutting corners of an image, it works well. However, when I
want to bevel the corners of an image, I get severe jaggies. Now, I
understand that Batik/SVG may not be made for this sort of thing, but I
was hoping there was some mechanism for doing this that won't eat up all
my processing power.
Here is a generated version of the code.
<?xml version="1.0" encoding="UTF-8"?>
<svg:svg xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="235" height="160" viewbox="0 0 235 160">
<svg:clipPath id="myClip">
<svg:path d="M 20 0,h195c 20 1, 20 1 20 20l 0 120,c 1 20, 1 20, -20 20,l -195 0,c -20 1, -20 1 -20 -20,l 0 -120c 1 -20, 1 -20, 20 -20,z"/>
</svg:clipPath>
<svg:g style="stroke:none;clip-path:url(#myClip)">
<svg:image y="0" x="0" width="235" height="160" xlink:href="file:///data/content/tsg/cmsblocks/holidayImg/images/Malaysia/penang_sunset.jpg"/>
</svg:g>
</svg:svg>
Thanks.
--
Kamal Bhatt
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Using Batik to manipute images
Posted by Kamal Bhatt <kb...@tt.com.au>.
Sorry for the late reply. This works now.
Thanks.
--
Kamal Bhatt
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Using Batik to manipute images
Posted by Kamal Bhatt <kb...@tt.com.au>.
> I was talking about anti-aliasing the image.
>> I tried geometricPrecision, but that had no visible effect what so ever.
>>
>
> This works for me (trunk and release 1.6).
> What version of Batik are you using?
> Also did you put shape-rendering on the clipPath element or
> somewhere else?
>
I put it on the clipPath. When that didn't work, I tried the image as well.
I am using cocoon 2.1.7 for that image, which is using the following
jar file:
batik-all-1.5.1.jar.
2.1.9 is using 1.6, but I don't have access to batik and cocoon 2.1.9 at
work, so I will have to wait till I get home to give it a go. I was
going to look at
http://xmlgraphics.apache.org/batik/supportedElements.html
to see if shape-rendering is supported in 1.5, but this is dead link (it
is linked here:
http://xmlgraphics.apache.org/batik/status.html#elementStatus)
> <svg:clipPath id="myClip" shape-rendering="geometricPrecision">
>
> Also I should mention that your 'd' attribute on the path
> is illegal according to the SVG spec and we have started respecting
> this (you can't have a comma between numbers and a path command).
>
>
OK, I will keep this in mind. I probably only need spaces anyway as I am
generating this based on an XSLT.
>> See the step look you get? Am I perhaps specifying my clipPath
>>
> incorrectly.
>
> Yes, I wouldn't call those "severe jaggies", just jaggies
> (I reserve severe for multi-pixel jaggies).
>
>
forgive my hyperbole. ;)
> Is it possible to apply a filter to blur the edges, thereby getting the
>> anti-aliasing look.
>>
>
> In graphics bevel is commonly used to refer any of a number of
> "lighting" effects which make an object look raised and rounded
> (so the top/left edges will have a 'glint', and the bottom/right
> edges will be 'dark').
>
> This can be accomplished in SVG using the lighting filters,
> also if filters are not properly specified it is possible for
> them to cause multi-pixel jaggies.
Cool, sorry for the confusion.
--
Kamal Bhatt
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Using Batik to manipute images
Posted by th...@kodak.com.
Hi Kamal,
Kamal Bhatt <kb...@tt.com.au> wrote on 08/15/2006 08:40:01 PM:
> > If it is just the latter you can turn on anti-aliased clipping.
> > This can be done by adding: shape-rendering="geometricPrecision"
> > for the clipPath element.
> I was talking about anti-aliasing the image.
>
> I tried geometricPrecision, but that had no visible effect what so ever.
This works for me (trunk and release 1.6).
What version of Batik are you using?
Also did you put shape-rendering on the clipPath element or
somewhere else?
<svg:clipPath id="myClip" shape-rendering="geometricPrecision">
Also I should mention that your 'd' attribute on the path
is illegal according to the SVG spec and we have started respecting
this (you can't have a comma between numbers and a path command).
> See the step look you get? Am I perhaps specifying my clipPath
incorrectly.
Yes, I wouldn't call those "severe jaggies", just jaggies
(I reserve severe for multi-pixel jaggies).
> I am a newbie to SVG, but I don't understand how filter effects can be
> used here. Does bevel mean something else aside from "rounding corners"?
> Is it possible to apply a filter to blur the edges, thereby getting the
> anti-aliasing look.
In graphics bevel is commonly used to refer any of a number of
"lighting" effects which make an object look raised and rounded
(so the top/left edges will have a 'glint', and the bottom/right
edges will be 'dark').
This can be accomplished in SVG using the lighting filters,
also if filters are not properly specified it is possible for
them to cause multi-pixel jaggies.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Using Batik to manipute images
Posted by Kamal Bhatt <kb...@tt.com.au>.
>> I would like to use batik through Cocoon to manipulate images, for
>> example, to bevel the corners of an image or cut the corners of the
>> image. For cutting corners of an image, it works well. However, when I
>> want to bevel the corners of an image, I get severe jaggies.
>>
>
> Is the bevel done with a filter effect? Or when you say 'bevel' do
> you just mean 'rounded corners'? when you say 'severe' jaggies do
> you really mean that the clip isn't anti-aliased (so the jaggies are
> single pixel jaggies).
>
> If it is just the latter you can turn on anti-aliased clipping.
> This can be done by adding: shape-rendering="geometricPrecision"
> for the clipPath element.
>
>
I was talking about anti-aliasing the image.
I tried geometricPrecision, but that had no visible effect what so ever.
I found a link you can view:
http://clienttest/cms/agents/hello-Malaysia-penang_sunset.jpg
See the step look you get? Am I perhaps specifying my clipPath incorrectly.
I am a newbie to SVG, but I don't understand how filter effects can be
used here. Does bevel mean something else aside from "rounding corners"?
Is it possible to apply a filter to blur the edges, thereby getting the
anti-aliasing look.
--
Kamal Bhatt
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Using Batik to manipute images
Posted by th...@kodak.com.
Hi Kamal,
Kamal Bhatt <kb...@tt.com.au> wrote on 08/15/2006 12:36:38 AM:
> I don't know if this is the right mailing list, but here it goes.
It's the right list.
> I would like to use batik through Cocoon to manipulate images, for
> example, to bevel the corners of an image or cut the corners of the
> image. For cutting corners of an image, it works well. However, when I
> want to bevel the corners of an image, I get severe jaggies.
Is the bevel done with a filter effect? Or when you say 'bevel' do
you just mean 'rounded corners'? when you say 'severe' jaggies do
you really mean that the clip isn't anti-aliased (so the jaggies are
single pixel jaggies).
If it is just the latter you can turn on anti-aliased clipping.
This can be done by adding: shape-rendering="geometricPrecision"
for the clipPath element.
> Now, I understand that Batik/SVG may not be made for this sort of thing,
> but I was hoping there was some mechanism for doing this that won't eat
> up all my processing power.
>
> Here is a generated version of the code.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <svg:svg xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.
> org/1999/xlink" width="235" height="160" viewbox="0 0 235 160">
> <svg:clipPath id="myClip">
> <svg:path d="M 20 0,h195c 20 1, 20 1 20 20l 0 120,c 1 20, 1 20, -20
20,l
> -195 0,c -20 1, -20 1 -20 -20,l 0 -120c 1 -20, 1 -20, 20 -20,z"/>
> </svg:clipPath>
> <svg:g style="stroke:none;clip-path:url(#myClip)">
> <svg:image y="0" x="0" width="235" height="160" xlink:href="file:
>
///data/content/tsg/cmsblocks/holidayImg/images/Malaysia/penang_sunset.jpg"/>
> </svg:g>
> </svg:svg>
>
>
> Thanks.
>
> --
> Kamal Bhatt
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org