Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Processing 2: Creative Programming Cookbook
Processing 2: Creative Programming Cookbook

Processing 2: Creative Programming Cookbook:

eBook
₱579.99 ₱2000.99
Paperback
₱2500.99
Subscription
Free Trial

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Processing 2: Creative Programming Cookbook

Chapter 2. Drawing Text, Curves, and Shapes in 2D

In this chapter we will cover:

  • Drawing basic shapes

  • Working with colors

  • Working with images

  • Drawing text

  • Drawing curves

  • Calculating points on a curve

  • Drawing custom shapes

  • Manipulating SVG files

  • Offscreen drawing

Introduction


Now that you've installed Processing on your computer, and written your first sketches, we'll take a look at how you can draw stuff to the screen. We will start with rectangles and circles, and move on to more complex shapes. You'll also learn about working with colors, images, and text.

Drawing basic shapes


In Chapter 1, Getting Started with Processing 2, you learned how to draw lines and points in the Writing my first Processing sketch recipe. In this recipe, we'll take a look at how you can draw the most basic geometric shapes: rectangles, ellipses, triangles, and quads.

How to do it...

The following is the code for drawing the most basic shapes. The first thing you need to do is to write the setup() function and set the window size to 640 by 480 pixels:

void setup()
{
  size( 640, 480 );
  smooth();
}

The next piece of code is a function that will draw a grid with squares of 10 by 10 pixels. This function will be called in the draw() function:

void drawGrid()
{
  stroke( 225 );
  for ( int i = 0; i < 64; i++ ) {
    line( i*10, 0, i*10, height );
  }

  for ( int i = 0; i < 48; i++ ) {
    line( 0, i*10, width, i*10 );
  }
}

The last thing you need to do is write the draw() function. We'll start by setting the background to white, then draw the grid, and finally draw...

Working with colors


Color can be a great way to make your artwork more interesting. If you've used tools such as Photoshop before, you may know that there are different systems to describe a color. There is CMYK, LAB, HSB, HSV, RGB, XYZ, and so on. In Processing, you can use the RGB and HSB color modes to change the background, or set the fill or stroke of a shape. In this recipe, we'll explore how you can do this.

How to do it...

The first thing we'll do is declare a color variable named c, right before the setup() function. We'll set its value to a random color.

color c;

void setup()
{
  size( 640, 480 );
  smooth();

  c = color( random( 255 ), random( 255 ), random( 255 ) );
}

The second thing we'll do is to draw a rectangle with a gradient from black to white. This piece of code draws 255 rectangles, each with a different fill. This is the first piece of code that goes inside the draw() function.

Void draw()
{
  colorMode( RGB, 255 );
  background( 255 );

  // grayscale
  noStroke();
...

Working with images


In the previous recipes, we've drawn vector-based shapes to the screen. Processing can also be used to manipulate images. In this recipe, we'll take a look at loading an image, displaying it on the screen, changing the color of a pixel, and copy/paste parts of an image.

Getting ready

Open one of your favorite pictures, resize and crop it with Photoshop so it's 640 x 480 pixels. If you don't have Photoshop, you can use GIMP, an open source image editor. GIMP is available for Linux, Windows, and Mac OS X. You can get it at http://www.gimp.org/.

How to do it...

Create a new sketch and save it as working_with_images.pde. Once you have done this, you can drag the picture you've just resized onto the Processing editor. This is the easiest way to add files to your sketch. If you've completed these steps, you can start typing code. The first thing we'll do is declare some variables.

PImage img;

// some settings to play with
boolean pixelMode = false;
int copyWidth = 50;
int copyHeight...

Drawing text


If you are used to doing typesetting in applications such as InDesign, you'll know that you have a lot of control over things such as kerning and hyphenation. In Processing, this won't be the case. The things you can do with typography are somewhat limited, but you can still do quite a lot.

Getting ready

To get started, you'll need some fonts to work with. I've used Ostrich Sans and Junction, both open source fonts by The League of Moveable Type. You can download them at http://www.theleagueofmoveabletype.com. After downloading these fonts, you need to install them on your machine, so they are available to use.

To use fonts in Processing, you need to convert them from their original file format to the .vlw file format Processing uses. You can do this with the Create Font tool. Select the font you need, set a size, and click on the OK button. The .vlw font will be saved to the data folder of your sketch.

How to do it...

We'll start by declaring two PFont objects, one for each font...

Drawing curves


Straight lines can be boring sometimes, so it might be useful to draw curved lines to make your artwork look a little more organic. In this recipe, we'll take a look at how you can draw Bézier curves and Catmull-Rom splines. If you have used vector graphics software such as Adobe Illustrator or Inkscape before, you might recognize the Bézier curves we'll draw.

How to do it...

The first thing we need to do is to import the OpenGL library. This library is usually used to draw in 3D. Although we won't be drawing in 3D in this example, we need to import it because the bezierDetail() and curveDetail() functions don't work with the standard 2D renderer. You can import the OpenGL library by going to the Sketch | Import Library... | OpenGL. Once you have done this, you can type the following code into the editor:

import processing.opengl.*; 

void setup()
{
  size( 640, 480, OPENGL );
  smooth();
}

Inside the draw() function, we'll start with drawing some Bézier curves. The bezierDetail...

Calculating points on a curve


In the Drawing curves recipe, you've learned how to draw Bézier curves and Catmull-Rom splines. This example will teach you how you can use the bezierPoint() and curvePoint() functions to calculate points on those curves.

How to do it...

This is the code for the recipe. I've used the noise() function to animate the point as it moves along the curve. Mouse movement is used to animate the curve drawn with the curve() function.

float noiseOffset;

void setup()
{
  size( 640, 480 );
  smooth();

  noiseOffset = 0.0;

  rectMode( CENTER );
}

void draw()
{
  noiseOffset += 0.01;

  background( 255 );

  // Bézier curve
  stroke( 0 );
  noFill();
  bezier( 40, 200, 120, 40, 300, 240, 600, 40 );

  stroke( 255, 0, 0 );
  line( 40, 200, 120, 40 );
  line( 600, 40, 300, 240 );

  fill( 255 );
  rect( 120, 40, 4, 4 );
  rect( 300, 240, 4, 4 );	

  float n = noise( noiseOffset );

  float x = bezierPoint( 40, 120, 300, 600, n );
  float y = bezierPoint( 200, 40, 240, 40...

Drawing custom shapes


Squares and circles might be boring after using them for a while. Luckily for you, Processing has some functions to draw custom shapes. We'll take a look at how you can write functions for drawing stars and flowers.

How to do it...

We'll start by writing the code for the setup() function. I've used the frameRate() function to make the sketch run at one frame per second.

void setup()
{
  size( 640, 480 );
  smooth();
  frameRate( 1 );
}

The next thing we'll do is write a function to draw a star. The function takes three parameters: an integer for the number of spikes on the star, and two float variables for the inner and outer radius we'll use to calculate the vertices.

void star( int numSpikes, float innerRadius, float outerRadius )
{
  int numVertices = numSpikes * 2;
  float angleStep = TWO_PI / numVertices;

  beginShape();
  for ( int i = 0; i < numVertices; i++ ) {
    float x, y;
    if ( i % 2 == 0 ) {
      x = cos( angleStep * i ) * outerRadius;
      y = sin...

Manipulating SVG files


A great thing about Processing is that you don't always have to draw your own shapes. You can draw just about anything you want in a vector editing program, and export it as an SVG file to use in Processing.

Getting ready

The first thing you need to do is create an SVG file to use in your sketch. Processing supports SVG files made with Adobe Illustrator or Inkscape. Inkscape is an open source vector editor, so it might be useful if you don't have access to an expensive piece of software, such as Illustrator. You can download it at: http://inkscape.org/.

Create a new sketch and save it as manipulating_svg_files.pde in your sketchbook. Save your SVG file in the data folder of your sketch. You can do this by dragging the SVG file on the Processing editor, just like you did in the recipe on working with images.

How to do it...

We'll start with declaring some PShape objects and loading them inside the setup() function. The snowFlake variable is used to load your SVG file, the...

Offscreen drawing


In some cases, you want to be able to draw things on a blank image, before drawing it to the screen. This can be easily done in Processing with the PGraphics object.

How to do it...

The first thing you need to do is declare a PGraphics object at the beginning of your sketch, and initialize it with the createGraphics() function inside setup(). I've added the x and y variable to add some animation to the sketch. You can clear the background by clicking the mouse.

PGraphics pg;

float x;
float y;

void setup()
{
  size( 640, 480 );
  smooth();

  pg = createGraphics( 64, 64, JAVA2D );

  background( 255 );
  imageMode( CENTER );

  x = 0;
  y = 0;
}

The first thing we'll do inside the draw() function is draw some lines onto the PGraphics object. The object will then be drawn to the screen using the image() function. The last piece of code inside the draw function is used to calculate the x and y values to animate the sketch.

void draw()
{
  pg.beginDraw();
  pg.background( 255...
Left arrow icon Right arrow icon

Key benefits

  • Explore the Processing language with a broad range of practical recipes for computational art and graphics
  • Wide coverage of topics including interactive art, computer vision, visualization, drawing in 3D, and much more with Processing
  • Create interactive art installations and learn to export your artwork for print, screen, Internet, and mobile devices

Description

Processing is probably the best known creative coding environment that helps you bridge the gap between programming and art. It enables designers, artists, architects, students and many others to explore graphics programming and computational art in an easy way, thus helping you boost your creativity. "Processing 2: Creative Programming Cookbook" will guide you to explore and experience the open source Processing language and environment, helping you discover advanced features and exciting possibilities with this programming environment like never before. You'll learn the basics of 2D and 3D graphics programming, and then quickly move up to advanced topics such as audio and video visualization, computer vision, and much more with this comprehensive guide. Since its birth in 2001, Processing has grown a lot. What started out as a project by Ben Fry and Casey Reas has now become a widely used graphics programming language. Processing 2 has a lot of new and exciting features. This cookbook will guide you to explore the completely new and cool graphics engine and video library. Using the recipes in this cookbook, you will be able to build interactive art for desktop computers, Internet, and even Android devices! You don't even have to use a keyboard or mouse to interact with the art you make. The book's next-gen technologies will teach you how to design interactions with a webcam or a microphone! Isn't that amazing? "Processing 2: Creative Programming Cookbook" will guide you to explore the Processing language and environment using practical and useful recipes.

Who is this book for?

This book targets creative professionals, visual artists, designers, and students who have a starting knowledge of the Processing Development environment and who want to discover the next level of Processing. Anyone with a creative practice who wants to use computation in their design process. A basic understanding of programming is assumed. However, this book is also recommended to the non-artistic, looking to expand their graphics and artistic skills.

What you will learn

  • Draw expressive shapes and images in 2D and 3D and get inspiration for your creativity
  • Extend the possibilities with Processing using libraries that help you create interactive computational art
  • Play and control video files using some of the coolest recipes with unmatched techniques
  • Visualize music and even live audio
  • Build basic tools for audio visual performances
  • Interact with computers using a webcam
  • Create Processing sketches for the web using the new JavaScript mode
  • Create interactive applications for your Android devices
Estimated delivery fee Deliver to Philippines

Standard delivery 10 - 13 business days

₱492.95

Premium delivery 5 - 8 business days

₱2548.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 20, 2012
Length: 306 pages
Edition : 1st
Language : English
ISBN-13 : 9781849517942
Languages :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Philippines

Standard delivery 10 - 13 business days

₱492.95

Premium delivery 5 - 8 business days

₱2548.95
(Includes tracking information)

Product Details

Publication date : Sep 20, 2012
Length: 306 pages
Edition : 1st
Language : English
ISBN-13 : 9781849517942
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₱260 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₱260 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 7,502.97
Mastering OpenCV with Practical Computer Vision Projects
₱2500.99
Processing 2: Creative Programming Cookbook
₱2500.99
Processing 2: Creative Coding Hotshot
₱2500.99
Total 7,502.97 Stars icon
Banner background image

Table of Contents

11 Chapters
Getting Started with Processing 2 Chevron down icon Chevron up icon
Drawing Text, Curves, and Shapes in 2D Chevron down icon Chevron up icon
Drawing in 3D–Lights, Camera, and Action! Chevron down icon Chevron up icon
Working with Data Chevron down icon Chevron up icon
Exporting from Processing Chevron down icon Chevron up icon
Working with Video Chevron down icon Chevron up icon
Audio Visualization Chevron down icon Chevron up icon
Exploring Computer Vision Chevron down icon Chevron up icon
Exploring JavaScript Mode Chevron down icon Chevron up icon
Exploring Android Mode Chevron down icon Chevron up icon
Using Processing with Other Editors Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.3
(8 Ratings)
5 star 62.5%
4 star 12.5%
3 star 12.5%
2 star 12.5%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Lon Dec 20, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is really a fantastic book. Each of the 90 or so recipes includes a description, sample code, and a walk-through of how it works. Many of the sketches are simpler than I would like but that simplicity also makes them easy to follow. Along with that, references are given for outside resources, which makes the examples a useful launching point. This is definitely a 5-star book for anyone learning processing and I'd give it 4 stars as a useful reference for those who are already fairly proficient.
Amazon Verified review Amazon
Luis Hernández Nov 18, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Excellent!
Amazon Verified review Amazon
Andrej May 02, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Bei diesem Buch gibt es fast nichts zu meckern:ProFür einsteiger und leicht fortgeschritteneSuper verständlich erklärt.wenn man fragen (fragen heist fragen zum programmieren) hat antwortet die firma einen auch (Klasse)Kontra:Naja es ist ein buch und bei mir war es so das ich mir dieses buch gekauft habe damit ich weiß wie man videos in processing abspielen kann naja und bei einer neueren version in processing ging das nicht da eine datei geändert wurde. Daher musste ich 2 wochen auf eine lösung warten aber ich habe sie einfach bequem und kostenfrei bekommen einfach super.Bücher halten nun mal einen gewissen stand x fest. da processing öfters verändert wird kann man nicht ganz erwarten das alles reibunglos leuft.
Amazon Verified review Amazon
M Pearson Dec 12, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I loved the no-nonsense approach of this book.As more and more Processing books hit the market, each new book has to think carefully about its approach, attempting to provide something that isn't already out there. Vantomme's book has taken this into account, being aimed squarely at the more advanced/impatient Processing user. It implicitly acknowledges that there are already plenty of great beginners guides out there, and that the reader has probably already read a few of them, which allows this book to speed through the hand-holding stage and get onto the meatier topics.The cookbook approach, chunking the teaching into manageable recipes of no more than a few pages each, makes it very easy to dip in and out of. And this conciseness means it can cover a lot more topics, in much fewer pages. I don't think there are any other Processing books that cover 3D, Computer Vision, Audio Viz, Android development, and writing your own libraries quite as succinctly as this.Highly recommended.
Amazon Verified review Amazon
RA Nov 30, 2012
Full star icon Full star icon Full star icon Full star icon Full star icon 5
At a GlanceJan Vantomme's Processing Cookbook bills itself as "Quick answers to common problems." In this regard, the author nicely succeeds in accomplishing that goal. The book is well organized, quite readable, and filled with many useful entry points for coders looking to jumpstart their projects. While it should not be the first book on Processing in your library (nor is it intended as such), it is a worthy addition for anyone wanting handy recipes that help serve up tasty procedural dishes.The AudienceThose who are new to both Processing and programming in general are probably advised to look elsewhere. However, it would be unfair to say that the book is beginner-hostile, as the first few chapters are a nice orientation in the Processing environment. Intermediate to advanced coders would probably have no difficulty using this as a suitable guide to getting started in the Processing language. Still, the main audience for this book is likely to be those who are already familiar with Processing, and can benefit from having a good set and a wide variety of starting points. This book would be at home in both the classroom and the individual bookshelf.The BookChapters progress gradually from beginning topics to more advanced ones. Each chapter follows a set structure and format which fosters a feeling of familiarity even for new topics. Readers move easily through a "Getting ready" section to the more detailed "How to do it..." section. Afterward, there is a review section "How it works...," and occasionally a "There's more..." or "See also" section for additional areas to explore. When encountering new material, it's nice to have these guideposts so the terrain never feels totally foreign.These are not in-depth tutorials. Like most recipe books, the idea is not to teach you how to cook, but to give you the ingredients and steps necessary to make something happen. You could choose to follow the instructions exactly, and get the same exact results, but the expectation is that you'll use these recipes to breeze through the tedium in order to focus on concocting your own special sauce.For my review, I used the digital version of the book. I installed a copy on my desktop setup (.pdf) and my iPad (eBook). While I generally prefer books in a physical format, programming and technical manuals can be unwieldy. With the digital version, I could easily switch between coding and reading on my desktop, and reading on the go with my tablet. In both environments, the layout is clear and legible, with the added benefit of being able to change document and content size as needed. The book design is easy on the eye, and avoids much of the ponderous density that plagues so many technical books.The CodeAll the code examples in the book are available for download. The book is written for Processing version 2.0, which as of this writing (late 2012) is still in beta. This means the examples are forward-looking, and should remain valid and useful for some time to come. The extra good news is that I tested the code in Processing 1.5.1, and found it to be mostly backward compatible as well. A very few sketches required slight modifications to run in the older version of Processing, but these tended to be obvious for the moderately experienced user. Exceptions to this were in the chapters on video, Android development, and writing libraries. For these, the user will need the more recent version of Processing.The code itself is generally easy to follow and nicely organized. Comments are minimal and unobtrusive, but present when you need them. There is nothing particularly flashy or clever -- the author seems much more interested in giving you a good set of workaday tools than showing off artsy syntax.The output as well is nothing fancy, just enough to make sure the sketch is working as intended, and not be completely without interest. Here again, there seems to be just the right balance in keeping you motivated while encouraging you to add your own creativity.CriticismsThere's not a lot to fault with this book. There are a few typos here and there, but these are not terribly distracting. Besides, there's a link in the preface for how and where to submit errata.Although the book generally flows nicely, the illustrations of the output come after the explanations. I found myself wanting to visually know ahead of time what the goal of a particular piece of code was. Of course, part of learning to program involves being able to look at code and visualize what is supposed to be happening, so in this regard the reader is being respected by not being spoon-fed.Sooner or later, everyone develops their own coding style and preference. I like variable names that are semantic even if they take longer to type and take up more space on the page. I have grown to dislike variable name choices that cause me to look around in other parts of the code to remind me what their meaning is supposed to be. In other words, the author's coding style is not an exact fit for my own, but of course there's nothing to keep me from editing any code I would use to conform to my own way of doing things.I also wish the downloaded code chapters were named as well as numbered, according to their chapter headings (sub-headings are, by the way). When needing to grab code quickly to start a new project, I'd rather not have dig randomly through the top level directory, or open the book just to find a pointer to what I already know I want. Again, I can easily rename these folders myself, but it would be nice not to have to.Am I being nit-picky? Yes, simply because the author and publisher left me no major targets to shoot at.ConclusionWhen I read a book on programming or any technical manual, I always have several questions in mind. Can I read it in a linear fashion? Can I easily find the part I need as a reference? Is the experience pleasurable, or at a minimum, painless? Is it well organized and non-intimidating to look at? Is the content useful? Am I learning something new, but still accessible? Does the author seem more interested in helping me than in showing off? Is this something I will want to pick up again and keep finding value?To all of these, I can answer "yes" for Processing 2: Creative Programming Cookbook. Much of the code will be helpful for current projects, and much of the rest served to help me know what to look forward to when I step up to Processing version 2.0. Several of the chapters covered areas that I have not yet spent much attention on... this book has definitely lowered the bar for entrance into these topics, while raising my enthusiasm the same time.Processing is a rapidly maturing technology, and we've arrived at the point where there are a number of good books on the subject. We are lucky to have the comprehensive reference books, the thorough-going text books, and the gorgeous gallery books. Now we also have a cookbook, exactly the sort of thing you want when you need more than the standard online reference, and less than the ponderous textbooks.Processing 2: Creative Programming Cookbook is not the only book on the subject you will want to own. But once you have it, I wouldn't be surprised if it's the one you wind up turning to first, and most often.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela