34,79 €
Inkscape is an open source vector graphics editor with an intuitive user interface that has enough depth to make quality graphic designs with an attractive layout comparable to what you would make using Illustrator or CorelDraw. But choosing the right tool and the best approach to creating the desired effect can be challenging. Inkscape 0.48 Illustrator's Cookbook makes it super-easy for you to make your own vector-based graphics with the powerful Inkscape editor.
Inkscape 0.48 Illustrator's Cookbook provides you with the latest recipes to quickly create scalable vector graphics. Recipes in this book teach you about some of the most useful time-saving features in Inkscape accompanied by a list of keyboard shortcuts that you can easily memorize. In addition to covering use of Inkscape tools and their advanced features, examples from the recipes uncover solutions to common graphics problems.
The book starts off with familiarizing you with the tools and techniques in Inkscape that you can use to draw 2D shapes, calligraphic shapes, and 3D boxes easily. It then guides you through the most common color-changing steps performed in Inkscape along with some convenient procedures that can save your time when dealing with colors. It explains drawing using linear and radial gradients, which are irreplaceable, usage of clones to create interesting effects in illustrations, and live-path effects that can help you speed up constructing a shape and make the process more natural. You will learn how to make those tweaks on some of the ready-made filters, and in the final recipe we will create a filter from scratch. This practical book also contains recipes showing how to use Inkscape as a raster editor and how to achieve photo-realistic effects in Inkscape. For each important technique and skill, you'll see some simple recipes, then some more advanced recipes followed by an explanation of how Inkscape works to produce the desired effects in your illustrations.
By the end of this book you will be confident enough to create your own vector-based graphics with Inkscape.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Veröffentlichungsjahr: 2011
Copyright © 2011 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2011
Production Reference: 1180411
Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK.
ISBN 978-1-849512-66-4
www.packtpub.com
Cover Image by Asher Wishkerman (<[email protected]>)
Authors
Mihaela Jurković
Rigel Di Scala
Reviewer
Issa Mahasneh
Acquisition Editor
Dilip Venkatesh
Development Editor
Hyacintha D'Souza
Technical Editors
Vanjeet D'souza
Conrad Sardinha
Copy Editor
Neha Shetty
Indexer
Hemangini Bari
Editorial Team Leader
Akshara Aware
Project Team Leader
Priya Mukherji
Project Coordinator
Jovita Pinto
Proofreader
Aaron Nash
Production Coordinator
Kruthika Bangera
Cover Work
Kruthika Bangera
Mihaela Jurković is the owner of a small Croatian web development shop. Drupal, Inkscape, and Linux are the most common words in her open source dictionary. In addition to being a friendly ghost on the Inkscape forum she also enjoys photography, hiking, TED talks, and lolcats.
Rigel Di Scala discovered computer graphics on a Commodore VIC-20 as a young child. Before going insane trying to render artistic landscapes using only the limited character set of his primitive 8-bit computer, he upgraded to a CBM Amiga 500 and started creating his first bitmaps with Dan Silva's Deluxe Paint II.
During his college years he started working part-time as a Web developer and consultant for several institutions and companies, and later as a system administrator, journalist, and editor in the computer games industry.
Today he works as a web application developer for an IT company based in Milan. He promotes and uses open-source technology exclusively in his projects. Inkscape is his tool of choice for developing vector graphics.
In his free time, he likes to freeclimb, skydive, and read Reddit.
I would like to thank my family for their constant support in everything I do.
Issa Mahasneh is an independent open source consultant with relevant experience in web development and design using open source technologies.
Issa got a B.Sc. in Computer Science from the Jordan University of Science and Technology (JUST) and worked as a supervisor of the open source department in a software company located in Amman. For years, he has been involved in several projects including Drupal, Songbird, and Mozilla.
Since 2009, he is the president of the Jordan Open Source Association (http://jordanopensource.org), a non-profit organization that promotes Free Software and Free Culture in Jordan and the Arab World. A frequent speaker in open source conferences and events, Issa also organizes local BarCamps, Drupal Meetups, and Linux installation fests.
I would like to thank my parents, my brother, and my sister. A special thanks to my one-year old nephew, Muhammad, who made the review of this book more challenging by randomly pressing keys on my keyboard and by constantly trying to turn off my PC!
You might want to visit www.PacktPub.com for support files and downloads related to your book.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
http://PacktLib.PacktPub.com
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.
If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.
Inkscape is frequently mentioned, and lauded, as one of the best examples of open-source software available today. It is a mature, feature-full and flexible product, thanks to a very dedicated developer community. The latest version, 0.48, adds new tools, such as the Airbrush (which many have longed for), and advanced path editing, among many other additions and improvements.
Vector graphics are becoming increasingly important at the turn of this decade, now that the World Wide Web has begun its transition towards HTML5 technologies. All the major Web browsers are striving to conform to the SVG specification, as the attractiveness of scalable, high definition, three-dimensional, and Flash-free Web sites and games is irresistible. The future is bright, but the true outcome will ultimately depend on one decisive factor: user and developer adoption.
This is why a non-proprietary authoring tool such as Inkscape is important: it is a professional package for creating quality vector graphics which is freely available for everybody to use. Whether you wish to create Web site mockups, wallpapers to share with an Internet community, high-quality advertisements for the newspaper industry, digital art for a gallery exposition, or simply a Happy Birthday for your grandmother, Inkscape is available now and without limitations, to help you achieve your goal.
Chapter 1, Creating and Editing Objects Familiarize yourself with the user-interface and start drawing simple vector shapes.
Chapter 2, Editing Colors Learn the basics of coloring and use gradients to their full effect, by replicating an iconic image of a famous movie.
Chapter 3, Speeding Up Your Workflow Streamline and accelerate development with a set of commonly used techniques, tips and tricks.
Chapter 4, Creating and Editing Clones Use shape cloning to rapidly create interesting complexity in your drawing.
Chapter 5, Live Path Effects Create, assemble, and replicate objects programmatically in a variety of scenarios.
Chapter 6, Extensions Take full advantage of the many extensions available in Inkscape, to inspire and enhance your work.
Chapter 7, SVG Filters Experiment with SVG filter effects, taking vector graphics to a new level of sophistication, and create your own!
Chapter 8, Putting it All Together Use your knowledge, skills, and intuition to solve graphical problems in a variety of scenarios.
Chapter 9, Raster and Almost Raster Befriend bitmaps and use them in your vector drawings, by importing, converting (tracing), and exporting.
Chapter 10, Web Graphics Preparation Learn to design and prepare graphics for the modern web, from small but detailed widgets to the complete layout of webpage mockup.
Chapter 11, SVG in Websites Use vector graphics in your websites, games, and presentations, with the help of new extensions available in version 0.48.
Chapter 12, Draw Freely Complete your knowledge on SVG and Inkscape, by learning about document metadata, compiling the software from source, and programming your own extensions using Python!
You will, of course, need a working installation of Inkscape 0.48, or a more recent version if available. You can download an installer for your operating system from the official website:
http://inkscape.org/download
You will also need a programmers text-editor, perhaps a little more advanced than a vanilla notepad. Consider using TextEdit (Mac), GEdit (GNOME), KWrite (KDE), or Notepad++ (Windows). This last editor can be downloaded for free at:
http://notepad-plus-plus.org
Finally, if you are interested in developing extensions for Inkscape, you will need to install the Python programming library and tools in order to complete the relative recipes in this book. You can download the necessary software from the official Python web portal:
http://www.python.org
The first chapters of this book are aimed at the beginner with no previous experience of vector graphics design software packages. We will provide the fundamental concepts, an overview of the user interface, and start drawing straight away. No artistic talent is needed, just a bit of curiosity. The intermediate user will find these initial recipes useful in improving his or her competence in the use of the basic tools and workflows. The goal is to bring the reader to a level of expertise adequate for tackling the rest of the material in the book.
The more expert users will appreciate the later chapters, where we will illustrate advanced topics and demonstrate techniques for producing professional quality art, for use in web design, game development, and many other realms.
Whether you are a beginner or a battle-hardened veteran, a casual doodler or an academic artist, we hope you will enjoy the recipes in this book and find inspiration for your future works of art.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text are shown as follows: " License information is also inserted under svg:metadata element."
A block of code is set as follows:
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
Any command-line input or output is written as follows:
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: " The information we entered into the Document Metadata dialog is inserted into SVG code."
Warnings or important notes appear in a box like this.
Tips and tricks appear like this.
Feedback from our readers is always welcome. Let us know what you think about this book what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>, and mention the book title via the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or e-mail <[email protected]>.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books maybe a mistake in the text or the code we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
In this chapter, we will cover:
In this first chapter we will start with the basics of vector graphics design, by creating and manipulating simple geometric objects. Several important techniques used daily by graphics artists, such as shape editing, clipping, and masking, will help us greatly when building more complex objects later on.
Inkscape is a full-featured software package that provides us with a powerful and flexible set of tools. These tools can build beautiful drawings out of fundamental geometric objects (primitives), such as straight or curved lines, simple or complex polygons, or curved shapes.
Before we start drawing, let's take a quick look at the user interface and the facilities it provides:
We will begin with a couple of four sided polygons that we are all very familiar with:
In Linux and Mac OS X, the Alt key may not be immediately usable in Inkscape because it might be already assigned to a system shortcut. Refer to the Inkscape FAQ for a solution:
http://wiki.inkscape.org/wiki/index.php/FAQ
Here's what some of the preceding steps look like:
As we have seen, Inkscape's 2D shape tools create special kinds of objects because they have additional editing parameters for their geometric qualities. By converting them to regular path objects by using the Object to Path (Shift + Ctrl + C) option, these special parameters will be lost in the process. This is a tradeoff we will sometimes need to make in order to make use of some extensions and effects that can only be applied to regular paths.
Now that we know how to create simple shapes, we can advance to more interesting objects.
Moving the base radius handle away from its usual position can create wildly different shapes because tips and star inner corners form different relations, especially when combined with rounded corners. Try to recreate the following examples (you can find them in the StarsComplex.svg file):
You can also change the spiral stroke style to different kinds of dashes. Some very pretty effects can be achieved. (SpiralsDashed.svg):
Users trying Inkscape for the first time are sometimes confused when they don't find a special tool that creates lines. Such a tool isn't necessary because every object in Inkscape can be made to look like a line: remove the fill, adjust the stroke to your desired look and you've got a line. This means that all tools in Inkscape can be used to create lines, although some of them are more straightforward and better suited for what most users expect in that area.
In this recipe we will explore how to create freehand and straight lines.
Follow these steps to draw freehand and straight lines:
With the Pencil tool it is important to adjust the Smoothing: slider in order to obtain the desired smoothness in our curved lines, as it determines how sensitive the line is to our mouse movements.
The easiest way to create straight lines is to use one of the modes of the Pen (Bezier) tool (named after the French mathematician Pierre Étienne Bézier) that disables the feature to draw curved segments and creates a sequence of straight line segments.
The objects we created have default styles applied to make them look like lines, but they can also take fill color.
Stroke styles can affect the look of our "lines," and can be set in the Fill and Stroke dialogue (Shift + Ctrl + F) under the Stroke style tab. Joins can be Miter, Round, and Bevel, and Caps can be Butt, Round, and Square. Individual nodes (control points) of the path can be styled with a custom marker. The marker can be different for start, end, and middle nodes:
Both Pencil and Pen tools come with the option to automatically draw tapered lines. This can make creating lines more interesting, especially when using a graphics tablet. Before drawing a line we simply select a shape from the toolbar and the shape gets applied to the line when we finish drawing. Readymade shapes are Triangle in, Triangle out, Ellipse, and a custom shape that can be used by copying it and using the From clipboard option.
The following are some examples (they can be found in the Lines.svg file accompanying this chapter) where we used the Pencil with Smoothing: set to 50 and drew the letter "O":
In Inkscape, lines created by the Calligraphy tool are actually objects with a fill and no stroke. Although we can't bend them easily like we would with lines, they still are quite valuable in a lot of situations, especially when created with a graphics tablet a highly recommended purchase for any artist interested in creating freehand computer graphics.
Sketch mode is a special mode provided by the Pencil tool when holding the Alt key. This will treat all strokes as an attempt to draw one line, by computing the average and rendering the final result. Our various attempts are displayed in green as we keep drawing and a red line displays the current average, so we can keep tweaking the path until we are satisfied. The following example has been exaggerated to clarify the process; usually strokes are drawn closer together:
You might have guessed that the Pencil and modes of the Pen tool we used in this recipe can't create dots by simply clicking on canvas. However, there is a shortcut that simulates dots by drawing circles of a certain size, by holding Ctrl and clicking with Pencil and straight line modes of the Pen tool. Dot size can be adjusted in Inkscape Preferences (Shift + Ctrl + P). Using Shift + Ctrl will double the dot size and Ctrl + Alt will make it random.
For more information, refer to the recipes Creating calligraphic shapes and Creating smooth paths with Spiro Spline in this chapter, also refer to Chapter 5,
Nodes are control points that control the path shape. Nodes can also have tangent control handles that also contribute to the overall result. In this recipe we will use some of the most common node editing facilities.
The following steps will show you how to edit paths:
There are many shortcuts available for editing nodes and this recipe only uses some of them, so you are encouraged to go through the complete list. You can find them under Help | Keys and Mouse Reference (it will open a page in your default Web browser).
Once you learn the most common keyboard shortcuts for each editing mode, you will create graphics in a faster, more productive, and enjoyable way.
Pencil and Pen tools only create cusp nodes and smooth nodes, but symmetric nodes and auto-smooth nodes are also available. As we would expect, symmetric nodes have both handles of equal length and are collinear. To convert a node to symmetric, use Shift + Y or the Make selected nodes symmetric button on the toolbar. Auto-smooth nodes make sure that the segments they touch always remain smooth. If we move a handle of an auto-smooth node it will automatically become a smooth node. Use the Make selected nodes auto-smooth button (Shift + A) to convert any node into an auto-smooth node.
When we use the Delete key to delete selected nodes Inkscape will try to preserve the path shape as much as possible by changing the adjacent node types and handles angles and lengths. There are some cases where this kind of behavior is undesirable; for example, in an object that consists only of straight segments, we expect to get a straight line when we delete a node, and to get that kind of behavior we can use Ctrl + Del. There is an option to toggle this behavior in Inkscape preferences (Shift + Ctrl + P) under Tools | Node | Editing preferences.
In the previous recipe we saw that the Smoothing option in Pencil tool can affect the overall number of nodes created while drawing the path. If we need to smoothen or reduce the number of nodes in an existing path we can use the Simplify option (Ctrl + L). Inkscape preferences (Shift + Ctrl + P) under Misc hold an option where we can set the strength of the Simplify command; the larger the number, the more nodes are removed and the more distorted the path will be. It might be better to just start with the default value and, if needed, quickly use the Simplify option several times in succession for a better effect.
By holding the Alt key while moving nodes, we will move them in a non-uniform way. The nodes closer to the one that is actually clicked on to move the selection will move with an incremented step. Some fine examples of node sculpting can be viewed in the screenshots gallery of the Inkscape website:
http://inkscape.org/screenshots/gallery/
Path direction is important when putting text on paths or when using markers on strokes. It also affects the order in which nodes are selected using the Tab key. Visual indicators for path direction can be enabled in Inkscape preferences (Shift + Ctrl + P) under Tools | Node | Path outline. They only appear when path outline is enabled which can be done by toggling the Show path outline (without path effects) button on the Node toolbar:
For more information, refer to Creating freehand and straight lines and Creating paths using the Pen (Brazier) tool in this chapter.
The Pen (Bezier) tool is generally considered somewhat difficult to master but after some practice it can become a valuable tool when we need precision while drawing or tracing something along the edges. In this recipe we will write out the word "Mud" using the Pen tool. Our object will be composed of 2 sub-paths, one for the letters "Mu" and the other for the letter "d".
The following steps will show how to write words using the Pen tool:
