Monday, February 16, 2015

INKSCAPE: Converting a JPG or PNG into a SVG

"How do I create a SVG from an image I found on the internet?"

This question gets asked a lot in my Facebook group Cricut Explore and More...

Well... first, make sure you're not breaching copyright by doing so! You should always respect the intellectual property rights of the artist who created the image. Using unauthorised/licensed images is done at your own risk. Whether they are for personal use or to sell/giveaway makes no difference. 

Obviously your risk of receiving a cease and desist letter is minimal if you're using the image for your own personal use. But if you sell or share the file you made... or a product made with that file... then it's at your own risk. 


Now that we've covered that... let's move onto the tutorial.

In the example below I'm using a free image from https://openclipart.org/
These images are Public Domain images and are free to use, even commercially. For more information on the use of these images click HERE.

If you want to follow along using this image here's the link: https://openclipart.org/detail/46117/flower-six-red-petals-black-outline-green-leaf

You'll notice that there's 4 options when you go to download.


The first option will download the file as a SVG. But doing that spoils all the fun of you learning how to create a SVG yourself. So pick one of the other three options. Generally for the best result you should pick the highest resolution png or jpg image you can... which in this case means the "Big Image".

Click on that button and save the file to your computer. Don't forget to make a note of where you saved it.

Next you'll need Inkscape - If you don't have it installed yet, you can download it from https://inkscape.org/en/download/  Inkscape.org is the only site you should download this from. Downloading it from anywhere else can also add malware to your computer... and no one has time for cleaning that up!

Make sure you download the correct version for your computer.



If you are using Windows there are two versions... a 32 bit version and a 64 bit version. Check your System info (in Control Panel) to verify which version your computer is running.



For Mac users you will also need to install XQuartz. http://xquartz.macosforge.org/landing/


Finally... let's get started!


Open Inkscape, then click on File, Open (or the File, Open button)



Locate your file and click the Open button.



Click on the image to select it. (If you don't select the image your trace won't happen.)



Click on the Path menu and select Trace Bitmap 


The Trace Bitmap dialog box will open. 

We want to create a group of paths so we'll be using the bottom section of the box.

As we are using a coloured image click on the Colors button.

Next you need to count the number of colours in your image. In this image there are four... red, yellow, green and black (the outline)

If you select 4 from the Scans box and press Update you'll notice that the leaf is black. So the rule I usually go by is the number of colours in the image plus 1



The settings you should now have are:

  • Color
  • 5 scans (the number of colours in the image + 1 remember..)
  • Uncheck Smooth - Smooth applies a "Gaussian blur" to the image. Gaussian blur makes objects appear softer and less clearly defined. You don't want that so make sure you uncheck that box. 
  • Check the Stack Scans box - You can have this box unchecked but you'll get a different result. I'll show you that at the end of this tutorial. 
  • Check the Remove Background box. This will give your image a transparent background. 

Once you have done that click the Update button. You'll see that all the colours are now correct.

Now click the OK button. You won't notice anything happening because the newly traced image has been placed above the original image.



Click the Close button on the Tracing Bitmap dialog box

Click on the image and move it to the side. You'll notice on the status bar at the bottom of the screen it will show that this is a Group of 4 objects. That's your new image.



If you click on the other flower it will show as an Image in the status bar.

Move that one over to the right out of the way then click back on your new image



Now you need to ungroup this image to see the four different layers.

Click on the Object menu and select Ungroup



Click on the red, yellow and green parts of the flower and move them to the side.

You won't actually be needing those now so you can go ahead and delete them. Just click on each one and press your delete key. (You can also select those three layers at the same time by dragging your mouse around them and clicking delete.)



Now you'll be left with the outline of the flower.

Next we're going to fill the empty spaces with colour. You can use any colour that you like, but for this exercise we'll match the colours from the original image.

From the toolbar on the left click on the Color Picker button. (Shown bottom left of this image and looks like an eye dropper.)




Click on any one of the red petals.




Click on the Fill button (the paint bucket)




Now click on any of the unfilled petals in the new image.



Click in each of the other petals to fill them.



Press the Esc button on your keyboard to deselect the traced flower. (You must do that or your petal will be filled with the next colour.)

Click on the Color picker tool again.

Click inside the green leaf to select that colour



Click the Fill tool

Click inside the leaf on your traced flower to fill it



Press Escape

Click the Color Picker tool

Click inside the yellow area



Click the Fill tool then inside the middle of the flower to fill it with yellow.



Now that all sections of the flower have been filled we can delete the original image. Click on it and press Delete.



Holding down the Shift button on your keyboard click each of the red petals in turn to select them.



Select the Path menu

Select Combine



The petals will now be combined into one image (or path)

You can move the red, yellow and green images to the side




Now we'll create the shadow for the image. The outline of the image is transparent. If we left it that way it would cut like this image below, which would make layering the image difficult. What we want is a solid background.




With the outline selected (either drag your mouse around the flower or click on one of the black lines) click the Path menu

Select Break Apart




The image will be broken up into its individual objects (paths)




Now click the Path menu again and select Union




The image is now one solid path



Move the other components of the flower over the black outline




Select the entire shape (Ctrl A)




Click the Object menu and select Group



Now you're ready to save your project as a SVG.

Click the File menu

Select Save As



Give your file a name



Then click the Save As Type box and select either Inkscape SVG or Plain SVG. Both will work in Design Space so it doesn't matter which one you select.

From a search of the difference between the two types of files: "The Inkscape SVG has additional information added into its format to ease editing within Inkscape"

So pick which ever you want. Inkscape always defaults to Inkscape SVG.

Click the Save button. Don't forget to make a note of where you saved it.




Now that you've created your SVG you can import it into Design Space.

Log into your Design Space account and click Create New Project




Click Upload Image




Click the Upload Image button




Click the Browse button




Locate the file you saved to your computer and click Open




The preview of the SVG will appear in the preview window.

Add Tags if desired. Make sure you place a comma between your keywords

Click SAVE




The SVG will appear in your Uploaded Images Library.

Click on it to select it and press the Insert Images button




Because I didn't adjust the size of the image in Inkscape it imported into Design Space quite huge. Simply select the image, go the the Edit panel and adjust the height or width of the image to the size you want it.




 I've changed the height of my flower to 5"




Here is how your preview screen will look when you click Go. The four layers are placed on separate mats ready to cut.




And here's how they look in the Layers panel




You can ungroup them if you wish. And you can change the colour of any of the layers by clicking on the image in the layers panel and selecting a colour from the palette.




If you want to change this image from a cutting image to a Print then Cut image simply select the entire flower and click Flatten from the Layers menu. (Make sure your image fits in the maximum Print then Cut dimensions of:

Chrome: H 8" x W 5.5"
Firefox & Safari & IE: H 8.5" x 6"
Design Space iOS app: H 9.0" x W 6.5"




The image as it appears as a Print then Cut. Only the outline will be cut.



More info:

Changing the size of the image in Inkscape.

Make sure you lock the proportions so that the height and width will change at the same time.

The default size is set at pixels (px) so click the drop down box to change it to inches.

Then change the size.

Keep in mind that the size you set here will not be accurately reflected in Design Space. Setting the height of the object here at 5" will result in an image that imports at approx 6.24". The reason for that is that Inkscape doesn't properly convert image sizes to inches. But it will be close and you can fix the size when you get it into Design Space. 






Remember the Stack Scans option during the tracing process?

We left Stack Scans checked, however in this example we could have had it unchecked. In both cases we are deleting the coloured sections of the flower anyway, so it doesn't matter which we picked as all we wanted was the black outline.

This shows the different results you would get...



Lesson over! Hope you learned something! Comments are welcome if you have any questions.

Happy crafting!  ♥








Related Posts Plugin for WordPress, Blogger...