InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Inkscape tutorials

  • SVG - beginner tutorial
  • Animation using Inkscape and Jquery
  • How to create a logo using Inkscape
  • How to create and use color palettes in Inkscape
 
  • Home
  • > Tutorials
  • > Inkscape Tutorials

How to create simple animation using Inkscape and Jquery

By admin | Last updated on Jan 11, 2016

A quick tutorial to show how to use layers in Inkscape to generate image frame and use Jquery to create a simple animation.

Inkscape layers

Using layers is a powerful concept to manage an image and create multiple frames of an image which can be used in animation. We will create a cartoon head with mouth closed in one layer and opened in another.

Here is how Inkscape ui looks like with some of the tools highlighted we’ll use in this tutorial.

inkscape-layers-ui

These are the steps to demonstrate the use of layers:

  1. First create a new document with 400×400 pixels size (or default size is also fine)
  2. Click on Layer Menu and then Layers. This is open layer panel. Initially we will have one layer and whatever we create will be in that layer.
    inkscape-layers-one-layer
  3. Create a circle (using circle tool) and draw a line (drawl tool) in this layer (Layer 1). After that Click “+” icon in layer panel to create another layer (and name it Layer2)
    inkscape-layers-layer1-graphicsThis will create a simple graphics in layer 1.
  4. Now select Layer 2 from layer panel and create a smal circle as shown:
    inkscape-layers-layer2-graphicsNote that Layer 1 in hidden here (little eye icon before the layer name). Now play with the eye icon and view the graphics with various combinations of layers hidden/visible.
  5. You can now hide a layer and export the graphics to bitmap. Thus layers can be used to create various flavours of the image with low effort.

Here is the source code of above example: inkscape-tutorial-layers.svg

Here is the video version for creating layers in inkscape part:

Using Jquery for animation


Frame 1


Frame 2


Key-frame animation using above two frames

Jquery Source code for the animation

jQuery(function() {doAnimation();});
function doAnimation() {
  var currentImg = 1;
  var infiniteLoop = setInterval(function() {
    var imgSrc = "/data/inkscape/inkscape-tutorial-layers-frame" + currentImg + ".png";
    jQuery('#animationImg').attr("src", imgSrc);
    currentImg = 3 - currentImg;
  }, 1000);
}

Suggested posts:

  1. How to use wordpress facebook plugin comments box with lazy loading
  2. Comic strip – Tech CEO vs MLM Executive
  3. WordPress mysql query to get all custom keys and values for a post
  4. CSS animation-duration
  5. Some lessons and humour on entrepreneurship
  6. Mailchimp lightweight subscription form code
  7. CSS – align div in center vertically
  8. How to get docker container IP
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Inkscape Tutorials, jQuery, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress