FXG vs. SVG

3,281 views
3,125 views

Published on

When initial work on an XML-based graphics interchange format began, the natural first thought was to use SVG. However, there are key differences between SVG and Flash Player's graphics capabilities. These include core differences in SVG and Flash's rendering model with regards to filters, transforms and text. Additionally, the interchange format needed to be able to support future Flash Player features, which would not necessarily map to SVG features. As such, the decision was made to go with a new interchange format, FXG, instead of having a non-standard implementation of SVG. FXG does borrow from SVG whenever possible.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,281
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
32
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

FXG vs. SVG

  1. 1. „Alexandru Ioan Cuza” University, Iași Faculty of Computer Science FXG (Flash XML Graphics) vs. SVG (Scalable Vector Graphics) Research Project Researcher: Constantin Stan Computational Optimization Master 2nd Year Coordinator: Lect. Dr. Anca Ignat June 2010
  2. 2. FXG versus SVG Contents  Computer Graphics ......................................................................................................................... 3  Image types ..................................................................................................................................... 3  2D computer graphics ................................................................................................................. 3  Pixel art ................................................................................................................................... 4  Vector graphics ....................................................................................................................... 4  3D computer graphics ................................................................................................................. 4  Vector Graphics .............................................................................................................................. 5  FXG (Flash XML Graphics) ........................................................................................................... 5  Graphical Objects........................................................................................................................ 5  Symbols....................................................................................................................................... 6  Raster Effects .............................................................................................................................. 6  Text and Fonts............................................................................................................................. 6  SVG (Scalable Vector Graphics) .................................................................................................... 6  FXG vs. SVG .................................................................................................................................. 7  Conclusions ..................................................................................................................................... 8  References ....................................................................................................................................... 9      2
  3. 3. FXG versus SVG Computer Graphics  Computer graphics are graphics created using computers and, more generally, the representation and manipulation of image data by a computer. The development of computer graphics has made computers easier to interact with, and better for understanding and interpreting many types of data. Developments in computer graphics have had a profound impact on many types of media and have revolutionized animation, movies and the video game industry. Today, computers and computer-generated images touch many aspects of daily life. Computer imagery is found on television, in newspapers, for example in weather reports, or for example in all kinds of medical investigation and surgical procedures. A well-constructed graph can present complex statistics in a form that is easier to understand and interpret. In the media "such graphs are used to illustrate papers, reports, theses", and other presentation material. Many powerful tools have been developed to visualize data. Computer generated imagery can be categorized into several different types: 2D, 3D, 5D, and animated graphics. As technology has improved, 3D computer graphics have become more common, but 2D computer graphics are still widely used. Computer graphics has emerged as a sub-field of computer science which studies methods for digitally synthesizing and manipulating visual content. Over the past decade, other specialized fields have been developed like information visualization, and scientific visualization more concerned with "the visualization of three dimensional phenomena (architectural, meteorological, medical, biological, etc.), where the emphasis is on realistic renderings of volumes, surfaces, illumination sources, and so forth, perhaps with a dynamic (time) component". Image types  2D computer graphics  2D computer graphics are the computer-based generation of digital images—mostly from two- dimensional models, such as 2D geometric models, text, and digital images, and by techniques specific to them. The word may stand for the branch of computer science that comprises such techniques, or for the models themselves. 3
  4. 4. FXG versus SVG 2D computer graphics are mainly used in applications that were originally developed upon traditional printing and drawing technologies, such as typography, cartography, technical drawing, advertising, etc.. In those applications, the two-dimensional image is not just a representation of a real-world object, but an independent artifact with added semantic value; two- dimensional models are therefore preferred, because they give more direct control of the image than 3D computer graphics, whose approach is more akin to photography than to typography. Pixel art  Pixel art is a form of digital art, created through the use of raster graphics software, where images are edited on the pixel level. Graphics in most old (or relatively limited) computer and video games, graphing calculator games, and many mobile phone games are mostly pixel art. Vector graphics  Vector graphics formats are complementary to raster graphics, which is the representation of images as an array of pixels, as it is typically used for the representation of photographic images. There are instances when working with vector tools and formats is best practice and instances when working with raster tools and formats is best practice. There are times when both formats come together. An understanding of the advantages and limitations of each technology and the relationship between them is most likely to result in efficient and effective use of tools. 3D computer graphics  3D computer graphics in contrast to 2D computer graphics are graphics that use a three- dimensional representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering 2D images. Such images may be for later display or for real-time viewing. Despite these differences, 3D computer graphics rely on many of the same algorithms as 2D computer vector graphics in the wire frame model and 2D computer raster graphics in the final rendered display. In computer graphics software, the distinction between 2D and 3D is occasionally blurred; 2D applications may use 3D techniques to achieve effects such as lighting, and primarily 3D may use 2D rendering techniques. 3D computer graphics are often referred to as 3D models. Apart from the rendered graphic, the 4
  5. 5. FXG versus SVG model is contained within the graphical data file. However, there are differences. A 3D model is the mathematical representation of any three-dimensional object. A model is not technically a graphic until it is visually displayed. Due to 3D printing, 3D models are not confined to virtual space. A model can be displayed visually as a two-dimensional image through a process called 3D rendering, or used in non-graphical computer simulations and calculations. Vector Graphics  Vector graphics is the use of geometrical primitives such as points, lines, curves, and shapes or polygon(s), which are all based on mathematical equations, to represent images in computer graphics. Vector graphics formats are complementary to raster graphics, which is the representation of images as an array of pixels, as it is typically used for the representation of photographic images. There are instances when working with vector tools and formats is the best practice and instances when working with raster tools and formats is the best practice. There are times when both formats come together. An understanding of the advantages and limitations of each technology and the relationship between them is most likely to result in efficient and effective use of tools. FXG (Flash XML Graphics)  FXG, now version 2.0, describes an XML-based graphics interchange format for the Flash Platform. FXG contains high-level graphical and text primitives that can be used to create, group, transform and visually modify basic vector and bitmap shapes. The FXG rendering model follows very closely the Flash Player 10 rendering model and exposes all graphics capabilities of the Flash platform as well as offering expandable support to accommodate future capabilities of the Flash Player. The specification below dives into the technical details governing every element of FXG 2.0. Graphical Objects  FXG provides a general Path element that can be used to create a huge variety of graphical objects, and also provides common basic shapes such as Rectangles and Ellipses. These are convenient for hand coding and can be used in the same ways as the more general Path element. FXG provides fine control over the coordinate system in which graphical objects are defined and 5
  6. 6. FXG versus SVG the transformations that are applied during rendering. Symbols  FXG allows users to define and re-use multiple symbols within a single FXG document. A symbol defines a named grouping element containing graphical elements, grouping elements, and other symbols. Once a symbol is defined in a file, it can be referenced by name in other symbols in the same file. Symbols can be used at different sizes and orientations, and can be restyled to fit in with the rest of the graphical composition. Symbols cannot contain graphical objects directly. Instead, Symbols can contain Graphic grouping elements that can in turn define individual graphical objects. Symbols can also contain instances of other symbol definitions. Raster Effects  FXG allows the declarative specification of filters, either singly or in combination, that can be applied to any grouping element in the FXG document. These are specified in such a way that the graphics are still scalable and displayable at different resolutions. Text and Fonts  FXG includes text elements that can render a set of shapes based on a Unicode string combined with a referenced font. Fonts are referenced by family and style, relying on the rendering environment to provide the matching font definition. SVG (Scalable Vector Graphics)  SVG is a language for describing two-dimensional graphics in XML. SVG allows for three types of graphic objects: vector graphic shapes (e.g., paths consisting of straight lines and curves), images and text. Graphical objects can be grouped, styled, transformed and composited into previously rendered objects. The feature set includes nested transformations, clipping paths, alpha masks, filter effects and template objects. SVG drawings can be interactive and dynamic. Animations can be defined and triggered either declaratively (i.e., by embedding SVG animation elements in SVG content) or via scripting. 6
  7. 7. FXG versus SVG Sophisticated applications of SVG are possible by use of a supplemental scripting language which accesses SVG Document Object Model (DOM), which provides complete access to all elements, attributes and properties. A rich set of event handlers such as onmouseover and onclick can be assigned to any SVG graphical object. Because of its compatibility and leveraging of other Web standards, features like scripting can be done on XHTML and SVG elements simultaneously within the same Web page. SVG is a language for rich graphical content. For accessibility reasons, if there is an original source document containing higher-level structure and semantics, it is recommended that the higher-level information be made available somehow, either by making the original source document available, or making an alternative version available in an alternative format which conveys the higher-level information, or by using SVG's facilities to include the higher-level information within the SVG content. FXG vs. SVG  When initial work on an XML-based graphics interchange format began, the natural first thought was to use SVG. However, there are key differences between SVG and Flash Player's graphics capabilities. These include core differences in SVG and Flash's rendering model with regards to filters, transforms and text. Additionally, the interchange format needed to be able to support future Flash Player features, which would not necessarily map to SVG features. As such, the decision was made to go with a new interchange format, FXG, instead of having a non-standard implementation of SVG. FXG does borrow from SVG whenever possible. It is important to note that FXG specification follows much of the SVG specification format organization as well as copying related concept prose. There is another parallel with OOXML: rather than "what about ODF?" we have "what about SVG?". Both ODF and SVG are open standards that have a lot of goodwill and buy-in, and both have been designed with the more 'optimalist' mentality; surely we should go with the existing standard? However, both ODF and SVG were strongly influenced by their initial basic technical decisions. In the case of SVG, this meant that the page geometry followed a more PostScript-friendly 7
  8. 8. FXG versus SVG model (IIRC Adobe and IBM were champions for this), which was ultimately unacceptable for Microsoft (who had proposed VML) who withdrew from the SVG effort: VML was adopted by the early 2000's generation of MS applications and is part of the OOXML Transitional schemas, but has been superceded by DrawingML which is much neater. The syntax of Path data of FXG is borrowed from the SVG specification, and was designed originally to be concise. Compact Path data minimizes file sizes, and prevents the Path data from overwhelming human readers trying to understand overall file structure. FXG will only support the short, concise syntax. Conclusions  Adobe's FXG seems to be to PSD what OOXML is to .DOC: a re-factoring of a middle-aged binary format in XML with a focus on fidelity rather than elegance. The parallels with OOXML are really strong. The XML model for FXG is based as closely as possible on SVG. FXG borrows from SVG whenever possible. It uses a subset of the SVG Path but allows filters at a higher level. There were some early misconceptions that the FXG file format was designed to be a standard for raster graphics file inter-change, this has since been demonstrated to be incorrect. Pushing multiple specs that essentially do the same thing only serves to muddy the water. Knowing Adobe’s track record, I’m sure there will be good interchange functionality for FXG between various Creative Suite products and applications like Thermo. However, considering SVG already has acceptance as a standard, with a plethora of third-party tools for transforming and working with it, my excitement on the prospects of FXG are mixed at best.   8
  9. 9. FXG versus SVG References  http://en.wikipedia.org/wiki/Computer_graphics http://en.wikipedia.org/wiki/Vector_graphics http://en.wikipedia.org/wiki/Scalable_Vector_Graphics http://opensource.adobe.com/wiki/display/flexsdk/FXG+2.0+Specification http://en.wikipedia.org/wiki/FXG http://www.andersblog.com/archives/2008/09/flash_on_the_be.html http://broadcast.oreilly.com/2009/05/adobe-fxg-and-ooxml-the-big-fi.html 9

×