Scalable Vector Graphics (SVG) is a vector graphics standard established by the World Wide Web Consortium (W3C), an international standards organization for the World Wide Web. SVG is an XML-based vector image format for two-dimensional graphics that has support for interactivity and animation. Vector graphics, and particularly SVGs, offer an advantage over raster graphics in that they maintain clarity as they scale. An SVG image is rendered based upon the data that describes its shape, scale, color, and other properties.
Because SVG images are expressed as XML files, SVG images can theoretically be created and edited with a text editor, but such would be very time consuming and require specialized expertise. Instead, SVG images are typically created using vector graphics editing programs, such as InkScape®, available from Software Freedom Conservancy Corp., of New York, or Adobe Illustrator®, available from Adobe Systems Inc., of California. These graphics editing programs all operate through a Graphics User Interface (GUI). To edit an existing SVG graphic in these editing programs requires applying a selected operation to an element of the image to rewrite the XML file. The usual manner of creating of variations of an existing SVG image is generally accomplished by first creating multiple identical images in the GUI and then modifying each image manually to create each variation. Adobe has also made provision to create and import data into an image file by a merge function to create variations of images, but it is technical, cumbersome, time-consuming compared to this invention and cannot be effected solely from its user interface (see https://helpx.adobe.com/illustrator/using/data-driven-graphics-templates-variables.html) Unlike these other methods, the method and system described herein enables a user to programmatically create and display multiple variations simultaneously from the user interface or even automatically through the setting of defaults or variables.
While an SVG file is difficult to parse in its native form of XML, the data-based nature of an SVG graphic makes it possible to convert the paths or shapes and other properties of an image into an easier to parse non-relational data format such as Javascript Object Notation (JSON), so that the image data can be more easily accessed and manipulated in the resulting data array(s) or data object(s). Once the image is imported into the data object(s) in a useful form, the data values for each of the properties for each element, such as color (hue, saturation, luminosity) stroke, scale, and rotation, can be easily manipulated programmatically or through a user interface that allows the setting of values for the properties. Then, by setting random or sequential or user-selected values in a property, multiple variations of the digital image can be created and displayed simultaneously with the original. This allows a user to rapidly create and compare the multiple variations to visually drill down on a preferred design. By then selecting a new master from the variations and more narrowly defining the limits of the properties being varied, the design can be further refined.
Since the properties of each element are defined in the data object, and since it is possible to define an property for a specific element by assigning a variable (such as “sky” for the color property) which can then be defined by a call to outside data (such as time of day) or by reference to the property of another element (i.e. set hue +2 shades darker than that of element x), additional properties, variables and rules can be established for the image to programmatically create a desired variation.
This invention is a computer method and system is described for creating derivatives and variations of a master SVG image.
First, a method and system is described for creating a useful data object(s) for an existing SVG image for the specific purpose of manipulating that data to create derivative images. In the case of complex SVG graphic images (images containing a mixture of SVG elements, such as groups, paths, or shapes) this is done by inputting the data for each element to create the data object or objects. In the case of an image containing a compound path or paths, the compound paths are split by a programmatic operation into separate elements and the data for the resulting elements is incorporated into the data object(s) for that image.
This method and process also includes the option for the user to create additional properties in the data object for each image, and/or to define variables or rules for any of the properties in the data object, and/or to create groups for specific properties (i.e. color) through data object(s) and/or to further organize the elements for proper manipulation and display.
A method and system is also described for the creation of derivatives of the original or “master” SVG graphic by manipulating the values in one or more of the properties and/or variables (including but not limited to the size, color, hue, luminosity, saturation, pallette, stroke, gradient, opacity and rotation) for one or more of the elements contained in the data object, by assigning a number of stepped or random values within defined parameters, or from a specific set of values.
A method and system is described to then display one or more variations of the master SVG graphic created as described above simultaneously with the master SVG image, and allow further manipulation of the images by selection of a new master SVG image from those displayed, upon which the process and methods described above can be repeated.
The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments of the present invention and, together with the description, further serve to explain the principles involved and to enable a person skilled in the relevant art(s) to make and use the disclosed technologies.
In its totality, this is a description of a method and system that is a combination of the following methods and systems whereby an existing SVG graphic image, whether or not comprised of a compound path or a variety of other paths or shapes, is manipulated to create variations and derivatives of the initial master SVG graphic image, and whereby those images are displayed in a useful manner and output in a useful form. See
The following detailed description refers to the accompanying drawings that illustrate exemplary embodiments of the present invention. However, the scope of the present invention is not limited to these embodiments, but is instead defined by the appended claims. Thus, embodiments beyond those shown in the accompanying drawings, such as modified versions of the illustrated embodiments, may nevertheless be encompassed by the present invention.
References in the specification to “one embodiment,” “an embodiment,” “an example embodiment,” or the like, indicate that the embodiment described may include a particular feature, structure, or characteristic, but every embodiment may not necessarily include the particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same embodiment. Furthermore, when a particular feature, structure, or characteristic is described in connection with an embodiment, it is submitted that it is within the knowledge of one skilled in the relevant art(s) to implement such feature, structure, or characteristic in connection with other embodiments whether or not explicitly described.
The term “element” as used herein is defined as a shape or path of an SVG image in its original XML form or as parsed into its constituent key value pairs in a non- relational database (i.e. JSON). One or more elements, as converted, combine to create a data object or objects representative of the original SVG image.
The term “property” as used herein refers to the key value pair in the non-relational database (i.e. JSON). For example, a property would be {stroke: “black”} where “stroke” is the key and “black” is the value.
In the described embodiment of this invention, a master SVG graphic is created by the user using a third party SVG creator, such as Adobe Illustrator, Inkscape or similar program, or otherwise imported from an outside source into the user's computer.
Once the image is created or imported in a SVG format, this method and system then converts and organize the paths, shapes and/or data contained in the master SVG image into a useful data object of identifiable elements. This is done by a programmatic operation that:
a. Identifies whether the master SVG graphic image contains a compound path or paths;
b. If the graphic includes a compound path, a programmatic process splits the compound path into separate paths; this is done automatically for single path compound path images, and optionally for complex images containing a compound path or paths;
c. Then, for the master graphic image, inputs the properties (that may include but is not limited to path or shape definition, scale, color, hue, luminosity, saturation, opacity, stroke width and/or stroke color), for each element into a nonrelational database (i.e. JSON) data object or objects for that image;
d. Identifies and inputs the properties of the elements in a complex master image into group(s) (i.e. for color groupings) and/or nonrelational database (i.e. JSON) data object(s);
e. Identifies and converts shapes in complex images into identifiable elements and inputs the properties of those elements into nonrelational database (i.e. JSON) data object(s) for that image.
This method and system may then also include a programmatic operation wherein the elements in an image may be further processed to adjust the organization of those elements, as necessary to allow the proper viewing of the image.
It is not unusual for single path compound images to contain hidden layers especially those that have had multiple paths merged into the compound path image. To correct for this issue, a programmatic operation is conducted to detect if one element would entirely obstruct the view of another element by comparing the dimensions and position of the two elements. In this embodiment, for efficiency purposes, this comparison is made through a bubble sort comparing top, bottom, left and right values.
With respect to single path compound images that have been parsed into multiple elements, a programmatic operation is run whereby the elements are compared for symmetry on the x and or y axes by an operation that compares the starting point of the paths for those elements to determine if any elements are symmetrical on the x and/or y axes.
By applying a color palette with a different color (or grayscale) assigned to each element or group of elements of the master image, the derivative image or images (including those whose master is an all-black compound path SVG image) can be displayed with each resulting element drawn in a contrasting color (or shade of grayscale) in order to depict the separate individual elements that may be further manipulated in this process.
With respect to complex images, similar hue colors of the master image may be grouped manually or programmatically within the data object(s), so any single color groups in the image, such as “yellows” or “reds,” can be manipulated (or excluded from manipulation) as a group. Relative lightness and darkness inside of these hue groups can be detected by a programmatic operation that compares relative hues, so that the relative color shades may be preserved during the manipulation process.
All these operations may be set to operate either manually or programmatically.
Once the data for the master image has been parsed and processed into the usable data object(s) (
The result of the foregoing method and process is the creation of data object(s) that contains the definition of the master SVG graphic image, and allows for the manipulation of one or more of the properties of that image by variation of the values in such property(s) through this method and process.
This method and system then provides for manipulation of the master SVG image by varying the values of one or more of the properties or variables (i.e. stroke, color, hue, lightness, saturation, gradient, opacity, rotation, scale, etc.).
The first assigns a number of stepped (
The result of these operations would be one or more interim SVG images that may then be simultaneously displayed with the master image in the user interface.
The user can then select one of the interim images as displayed in the user interface (
As further illustration of the implementation of the embodiment described above, Applicant herein describes the drawings submitted in further detail.
The process begins with the master SVG image, the digital code for which may be imported from an outside source or created using a graphics editing program such as Adobe Illustrator or Inkscape.
The first step in the method and system uses an algorithm to determine if the master SVG image is a compound image, consisting of multiple elements (paths or shapes) that have been converted into a single compound image, or an image that doesn't consist of a single compound image.
If the image is a compound image, the image data is parsed in a process where the compound path is split into multiple elements, and each element is parsed for usable information (i.e. path or shape definition, scale, color, hue, luminosity, saturation, opacity, stroke width and/or stroke color) to contribute to the data object.
If the image is not a compound image, the data for each individual element (path or defined shape) is parsed to extract information from each element (i.e. path or shape definition, scale, color, hue, luminosity, saturation, opacity, stroke width and/or stroke color).
The output of this data parsing of the master image, whether compound or not, is placed into a non-relational database (such as JSON) to create a data object(s) representing that master image.
Once the data object has been created for the image, this data is used to create variations for the image by substituting a value or values for one or more of the attributes in the data object(s).
Selecting one of the variations will then reset the base data for that image, and the process can be repeated whereby the user can create a new set of variations according to the default/programmatic or user-specified settings.
When the user has selected a final image or images through this iterative process, the image(s) may be exported as SVG or other format.
A programmatic operation has been run that identified and split the compound image into data array for each separately identifiable element (path or shape definition) of the compound image.
The minimum and maximum x and y values of each element are used to compare to other elements in the image to determine if any element is fully obstructed by another. An algorithm (i.e. a bubble sort) is performed (
Then, the x and y start position for each element is determined.
The symmetry data objects are then used to establish color (or other attribute) groups on either the x or y axis.
This completes the processing of the compound image into usable data objects as depicted on
Through a user interface, the user is presented with properties they can choose to vary, and selects one or more of those properties on which to create variations.
The final step is to create the variations by applying values selected either by the user or by default or programmatically.
These values are then applied to the variations, and they are updated in real time.
The variations in a property can be accomplished in 3 different ways, regardless of whether they are user-defined or programmatic/default settings.
The variations can be created be setting the values for the selected property in a random fashion (
For example, if variations of stroke width are the desired result. The three methods would produce the following results (assuming a range of 0-5 was set):
The variations are updated in real time for the user to view and compare. (FIG. 3A(8)).
This application claims the benefits of the Provisional Patent Application No. 62/542,817, filed Aug. 9, 2017.