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 Sujesh Babu N <su...@gmail.com> on 2007/01/04 05:35:55 UTC

Extracting common shapes from SVG documents

Hi ,

I am working on an application , which uses SVG extensively as icons as well
as background images . We are planning to provide an option for mass editing
of the icons.

Is there any way i can extract common shapes( circles,rects,polygon.. etc )
from svg document?

any help will be appreciated .

thanks
Sujesh

Re: Extracting common shapes from SVG documents

Posted by th...@kodak.com.
Hi Sujesh,

"Sujesh Babu N" <su...@gmail.com> wrote on 01/04/2007 
06:41:03 AM:

> User can select multiple svg icons and system will display a set of 
> common shapes present in the icons . So we thinking of various ways 
> of extracting the common shapes from svg documents like ,creating a 
> set of rules, which states, the different attributes should match, 
> for the basic shapes to be considered identical or similar. 

   Using Batik you can iterate through the entire DOM or
use getElementsByTagNameNS to find all elements of a particular
type.  You can then check the attributes on the element.

   This however is probably not going to work real well as 
in SVG there can be many ways to produce similar visible shapes
and it might be quite common to have "the same shape" but
shifted a few pixels in multiple icons.

   I wish you the best of luck, but I suspect that this
is the sort of feature that sounds really good but 
probably isn't very useful in "The Real World".

> This is the scenario , i am trying to find a solution. I am looking 
> for a better way so that i can extract common shapes from SVG documents
> 
> Thanks again

> On 1/4/07, Sujesh Babu N <su...@gmail.com> wrote: 
> Hi ,
> I am working on an application , which uses SVG extensively as icons
> as well as background images . We are planning to provide an option 
> for mass editing of the icons.
> Is there any way i can extract common shapes( circles,rects,
> polygon.. etc )  from svg document?
> any help will be appreciated .
> thanks
> Sujesh

Re: Extracting common shapes from SVG documents

Posted by Sujesh Babu N <su...@gmail.com>.
I will explain the requirement more clearly ...I am working on application
to create mobile themes for various mobile devices . We are using
Java/Eclipse/ Batik to build the same .

In the tool , user has the option to edit the svg files using an external
editor like inkscape/illustrato r. Currently for editing the svg icons ,
user need to edit each of the icons individually. So we thought of providing
a mass editing functionality .

User can select multiple svg icons and system will display a set of common
shapes present in the icons . So we thinking of various ways of extracting
the common shapes from svg documents like ,creating a set of rules, which
states, the different attributes should match, for the basic shapes to be
considered identical or similar.

This is the scenario , i am trying to find a solution. I am looking for a
better way so that i can extract common shapes from SVG documents

Thanks again

On 1/4/07, Sujesh Babu N <su...@gmail.com> wrote:
>
> Hi ,
>
> I am working on an application , which uses SVG extensively as icons as
> well as background images . We are planning to provide an option for mass
> editing of the icons.
>
> Is there any way i can extract common shapes( circles,rects,polygon.. etc
> )  from svg document?
>
> any help will be appreciated .
>
> thanks
> Sujesh
>