SVG Scalable Vector Graphics And the SVG Perl Module Tamir Lousky April 2010Rehovot Perl Mongers.

Slides:



Advertisements
Similar presentations
Images Images are a key component of any multimedia presentation.
Advertisements

HTML5 Overview HOANGPT2. 1. General 2. New Elements List 3.
What is Multimedia ? Multi ( Multiple ) and Media ! So…. Information in multiple formats, including text, images, audio, video and animation :) It makes.
Lesson 15 Presentation Programs.
CHAPTER 20 CREATING SVG GRAPHICS. LEARNING OBJECTIVES How to embed a graphic stored within a.SVG file in an HTML page How to use the and tag pair to specify.
Iframes & Images Using HTML.
/k/k 1212 Cascading Style Sheets Part one Marko Boon
Lecture # 11 JavaScript Graphics. Scalable Vector Graphics (SVG) Scalable Vector Graphics (SVG), as the name implies, are - scalable (without pixelation):
Presented By, Sripad Sarode
Introduction to SVG Prepared by K.M.SO Department of Computer Science ver. 2 last update: June 2004.
Introduction to SVG & Batik Presented by Shang-Ming Huang.
© 2009 Research In Motion Limited BlackBerry themes and animated graphics.
WHAT IS SVG?. SVG stands for Scalable Vector Graphics SVG is used to define vector-based graphics for the Web SVG defines the graphics in XML format SVG.
Fonts Typeface Typography. Leading Spacing between lines.
Scalable Vector Graphics (SVG) Aug’10 – Dec ’10. Introduction Scalable Vector Graphics (SVG), an extremely versatile 2-D graphics format designed primarily.
Director of Computer Center, DaYeh University Ku-Yaw Chang.
Evaluation of HTML5 Graphics for Data Structure Visualization
COMP Bitmapped and Vector Graphics Pages Using Qwizdom.
HTML Boot Camp: Rules and Images
XML – 1h. XML: Contents What is XML? What is “Well Formed” XML? What is “Valid” XML? –Document Type Definitions –Scalable Vector Graphics (SVG) XML in.
New Tags, New Attributes, New JavaScript APIs, Forms, Validation, Audio, Video, SVG, Canvas Doncho Minkov Telerik Corporation Technical.
School of Computer Science & Information Technology G6DPMM - Lecture 17 Scaleable Vector Graphics.
Tutorial 7 Working with Multimedia. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Explore various multimedia applications.
Tutorial 7 Working with Multimedia. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Explore various multimedia applications.
SVG for Designers Tom Hoferek. Objectives Introduce SVG Illustrate its capabilities Demonstrate SVG in action Speculate, discuss, answer questions.
1 Scalable Vector Graphics (SVG). 2 SVG SVG is an application language of XML. “SVG is a language for describing two- dimensional graphics in XML. SVG.
Lecture 16 Image Document Formats. Bitmap vs. Vector Images Bitmaps do not generally.
Calculating Fractal Dimension from Vector Images Kelly Ran.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. SVG Ellen Pearlman Eileen Mullin Programming the Web Using XML.
تکنیک های پیشرفته در برنامه سازی وب ) اسلايد نهم SVG - ) جوانمرد Website: به نام خدا.
Cascading Style Sheets Robin Burke ECT 360. Outline Midterm CSS CSS selection Positioning SVG Final project.
Adobe Dreamweaver CC: The Professional Portfolio Project 3: Photographer’s Web Site Working with static images Controlling backgrounds with CSS Working.
HTML – Other Tags Semantic Tags, Frames, Embed Multimedia Content, Others SoftUni Team Technical Trainers Software University
Glencoe Introduction to Web Design Chapter 8 Web Graphics 1 A bitmap file format that is used by scanners and graphics programs for use in print.
Introduction to XML Jussi Pohjolainen TAMK University of Applied Sciences.
SVG technology SVG technology is what we want? is what we want? Jaehoon Woo KNU Real-Time Systems Lab. KNU Real-Time Systems Lab.
HTML 5 (Part 1) – Start from SCRATCH. HTML 5 – Start from SCRATCH.
Scalable Vector Graphics Dietz Ellis 04/17/06. SVG SVG is a language for describing two- dimensional graphics in XML. SVG is a language for describing.
Part – 3 : HTML 5 SVG Tag. † SVG stands for Scalable Vector Graphics. † SVG is used to define vector-based graphics for the Web. † SVG defines the graphics.
WHAT IS SVG?. ESSENTIAL QUESTIONS What challenges do mobile devices present to Web designers? What are the basic concepts of responsive web design?
OCR Computing OGAT Web Technologies. What OCR need you to know… You are expected to have a working knowledge of the above web languages.
Unit 2.6 Data Representation Lesson 3 ‒ Images
Lecture 6 Data representation.
Working with Cascading Style Sheets
Web Basics: HTML/CSS/JavaScript What are they?
Objective % Select and utilize tools to design and develop websites.
Digital Illustration Chapter 6 File format.
SVG & DOM Manipulation via Javascript
XML Related Technologies
CSS Layouts: Grouping Elements
2D Design and Animation Introduction to Flash Introduction to Flash.
What is SVG?.
Chapter 4: Scalable Vector Graphics (SVG)
Scalable vector graphics
Basic Knowledge of Web creation
Objective % Select and utilize tools to design and develop websites.
A framework to create SVG graphics
Revision.
Intro to Virtual and Web Mapping
Introduction to D3.js and Bar Chart in D3.js
ImageEditing Understanding Image Resolution.
In-Depth Look at Internet Explorer 9
The Canvas.
Working with Multimedia
D3.js Tutorial (Hands on Session)
D3.js Tutorial (Hands on Session)
Week 10 - HTML SVG Student: Vladislovas Karalius
HTML5 - 2 Forms, Frames, Graphics.
What is SVG?.
Web Programming and Design
Presentation transcript:

SVG Scalable Vector Graphics And the SVG Perl Module Tamir Lousky April 2010Rehovot Perl Mongers

Vector vs. Raster Graphics ID, Position (x,y) RGB value (Alpha)

Vector vs. Raster Graphics 482 x 482 px 90 DPI 33 kb 62 x 62 px 72 DPI 3 kb

Vector vs. Raster Graphics Bitmap ( raster ) = pixels Vector = paths

Vector vs. Raster Graphics Control point Handle

Vector vs. Raster Graphics Infinite resize (with small file sizes)

Vector vs. Raster Graphics

Formats of Vector Graphics: Flash Highly popular Closed source Compiled to binary

Formats of Vector Graphics: SVG Text-based ( XML format ) Highly readable Easily editable … Accessible to scripting (embedded or external)

SVG Structure XML = Markup Language < element property1 = value1 property2 = value2... /> content

SVG Structure # Hello, I'm a SVG-XML doc # Start SVG, describe Image dimensions # ( Height, Width and Version) … # SVG closing tag

SVG Structure <svg width="5cm" height="4cm" version="1.1" xmlns=" <rect x="0.5cm" y="0.5cm" width="2cm" height="1cm"/> <rect x=".01cm" y=".01cm" width="4.98cm" height="3.98cm" fill="none" stroke="blue" stroke-width=".02cm" />

SVG Structure

<svg version="1.1" baseProfile="full" xmlns=" <g fill-opacity="0.7" stroke="black" stroke-width="0.1cm"> <circle cx="6cm" cy="2cm" r="100" fill="red" transform="translate(0,50)" /> <circle cx="6cm" cy="2cm" r="100" fill="blue" transform="translate(70,150)" /> <circle cx="6cm" cy="2cm" r="100" fill="green" transform="translate(-70,150)" />

SVG Structure

Advanced Parenting: SVG → SVG (embedding) Groups Elements → Elements ?

Other ways to create SVG docs

SVG.PM use strict; use SVG; # create an SVG object my $svg = SVG->new( width => 200, height => 200, ); print $svg->xmlify;

SVG.PM my $grp = $svg->group( id => 'group_y', style => { stroke => 'red', fill => 'green' }); # add a circle to the group $y->circle( cx => 100, cy => 100, r => 50, id => 'circle01' );

SVG.PM # The generic 'tag' method my $z = $svg->tag('g', id => 'group_z', style => { stroke => 'rgb(100,200,50)', fill => 'rgb(10,100,150)' } );

SVG in practice Supported in all web browsers.... Except Internet Explorer (will be included in IE9) Mobile: SVG-tiny / SVG-basic Compression: SVGZ ( tar-gz) HTML5 audio and video elements

More to Explore Animations! 3D with WebGL! Tons of other features /lib/SVG/Manual.pm

Exercise: File Size Blocks use strict; use warnings; use SVG; my $directory = 'C:\UrFolder'; opendir(my $dirh, $directory); = readdir( $dirh ); my $num_of_files = my $svg = SVG->new( width => 800, height => 600, ); my $block_width = int( 800 / $num_of_files ); # my $start_x = 0; foreach my $file ) { my $path = "$directory\/$file"; my $size = -s $path; print "$file => $size bytes\n"; my $height = int ( $size / ); # < Create rectangle with a height corresponding to the size, and an X value incrementally growing, and the fixed width > } # End of Foreach Loop my $output = $svg->xmlify; open my $output_file, '>', 'output.svg'; print $output_file $output; close $output_file;