Home About Calender Contact Advertise

Friday, 7 September 2018

How to Use the Bitmap Trace Tool In Inkscape

By With No comments:

In an earlier tutorial we showed how to create custom gradients in Gimp and use them to decorate butterfly wings. This tutorial follows on from that by showing how to take a photo of a butterfly then use the bitmap trace tool in Inkscape to turn the wing into an SVG graphic. As anyone who has used Inkscape before will know, the advantage of this is that the SVG graphic can be exported at any chosen size without losing image quality.

As well as showing how to use the trace bitmap tool in Inkscape, this tutorial will first prepare the photo in Gimp, then once the bitmap has been traced it will be modified, exported from Inkscape and then tweaked again in Gimp so it is ready to use in other graphics.

This may seem a complex tutorial but each step is very quick and simple and at the end you will have a butterfly image (or in fact any other image) you can use in numerous ways. Click each image to view full size if you need to.

How to Use the Bitmap Trace Tool In Inkscape


1/ This is the image we'll start with, so first of all open it in Gimp.


2/ To make it easier to use the trace bitmap tool in Inkscape we'll make the photo monochrome. It is possible to simply open the photo in Inkscape and apply the trace bitmap tool, but a little manipulation in Gimp to begin with lets us control the quality and appearance of the final result.

Removing a lot of unwanted detail from the image is what we want to do here, so firstly select Colors > Desaturate > Color to Gray.


3/ This is the desaturated image.


4/ To remove unwanted detail we'll use the Curves tool, so select Colors > Curves.



5/ The above window will open. Grab a point on the diagonal line to lighten or darken sections of the image. The extent this needs to be done will be different for every image, but the above image shows the settings used here.


6/ This is how the image was changed and is very close to what we want. There are still a few grey patches around the butterfly which can be painted out, although they're unlikely to show after the image has been traced in Inkscape.


7/ To create a more symmetrical appearance to the butterfly we just need half of the original image which we can later duplicate, invert it horizontally and then join to the other half.

For this reason whilst both the antennas of the butterfly are weak all we need do here is work on the right antenna.

Using Ctrl and the mouse wheel we have zoomed in on the head of the butterfly so we get a better view.

Create a transparent layer and select the Paths tool from the toolbox. left mouse click at the start of the antenna, click again at any sharp angle, then at the end. If there's a curve in the antenna hit Ctrl and click in the middle of the curve to add a node. Now drag the new node so the path curves to match the antenna.

In the lower half of the Toolbox panel hit the Stroke Path button.


8/ The above window will open. Select the width of the antenna line then hit the Stroke button when ready.


9/ This is the result of hitting the Stroke button.


10/ To create a more natural rounded end to the antenna, on a new transparent layer using the Ellipse tool (2nd from the top left) in the Toolbox, create a small elliptical shape. Fill it with black, then using the Rotate  and Move tools position it at the end of the antenna.

Now merge all the layers. A less destructive way would be to right click on one of the layers and from the drop down list select New from Visible. This will create a new layer consisting of all the visible layers. Your original layers will be intact.


11/ We now need to remove half of the image, so with the Rectangle Select tool (top left) from the Toolbox panel, drag a rectangle around the half we want to keep. Here its the right half. Be precise with the placing of the rectangle. Once positioned the edges of the rectangle can be adjusted by dragging them.



12/ Hit Image > Crop to Selection and the unwanted section of the image will be removed. Now export the image from Gimp, saving it as a PNG file rather than a JPeg.

Tracing The Bitmap In Inkscape


13/ Open the image from Gimp in Inkscape. You'll see a window similar to the above. Make sure the options are the same as here then click OK.


14/ You may need to make the page fit the Inkscape window by hitting 5 on your keyboard.


15/ With the image selected go to Path > Trace Bitmap (Shift > Alt >B).


16/ This panel will now appear to the top right of Inkscape. There are a number of options for tracing bitmaps, but the above settings should work well for this image. The best way to find out what effects the settings will have is to play around with them, remembering that you can always make use of the undo function (Ctrl > Z).

If you don't see a preview of the traced bitmap hit the Update button. When you're ready hit OK.


17/ The traced bitmap will appear directly on top of the original image, so you'll have to move it to see the difference between them both. If you're unhappy with the result, select the original image then tweak the settings in the Trace Bitmap window and hit OK again when you're ready.


18/ When you have a traced bitmap you're happy with the original image can be removed.


19/ There will probably be some missing details from the butterfly wing, so we'll now fix that. The original photo will be used as a guide so import it into Inkscape then move it below the bitmap by hitting Object > Lower (Page Down).

The image may also need to be adjusted to match the size of the bitmap by dragging the arrows at its corners and edges.


20/ To make it easier to distinguish between the bitmap and photo, the opacity of the photo has been lowered using the slider to the right (highlighted in red).

 Using the Bezier Tool


21/ Using the Bezier tool (highlighted in blue to the left) the veins of the wings can be drawn in. click at the start of the line you want to draw, then double click at the end.


22/ To the right of Inkscape there should be the Fill and Stroke panel. If you don't see it, hit Shift > Ctrl > F. Under the Stroke style tab the width of the line created with the bezier tool can be adjusted. The default setting is millimetres so its usually best to change this to pixels (px).

There are also options to choose if the end of a line should be flat or curved.


23/ In the image above a bezier line has been added to part of the wing that has a straight section as well as a curved section. To change direction in a line, click at the position you want the line to begin, which will add a node. Thenclick at the part of the line a new direction is needed.

The easiest way to create a curve within a bezier line is to click at the start of the line, then double click at the end.  Now select the Edit Paths tool (2nd from the top left highlighted in blue), then double click in the middle of where you want a curve. This will add a node to the middle of the line.

The tools highlighted in red in the above image can be applied to an active node. After adding the node to the middle of a line, select one of the node tools then drag the node. The first node tool will create a sharp angle, but the other three create curves with different features.

Once the node has been dragged the line will curve and handles will appear on the node. These handles can be seen in the above image and can be moved to adjust the curve..


24/ This image shows the wing with the veins drawn in.


25/ The background image is no longer needed so it has been removed. We're now going to duplicate this half of the butterfly.


26/ The first thing we need to do is drag the selection tool (first tool, top left, highlighted in blue) to form a box over all the elements of the image. This will select all these elements. Now select Object > Group (Ctrl > G). Now all the different elements of the image will act as one object.

Check all the parts have been selected and grouped by moving the group a little. Any parts that don't move have not been grouped. Select Edit >Undo until the grouped parts are moved back to their original position, then follow the steps to group objects.


27/ With all the parts grouped select Edit > Duplicate (Ctrl >D).


28/ We now have two wings. Use the Selection tool to move one wing to the left, then use the transform tool (highlighted in red in the above image) to flip the wing horizontally.

Export The Image From Inkscape



29/ Move both wing sections together and you have a perfectly symmetrical butterfly. The image still needs a little work however so now we'll export it from Inkscape then open it in Gimp.


30/ First select one half of the butterfly, hold down shift then select the other half. Now select File > Export PNG Image (Shift > Ctrl > E). A panel similar to the right of the above image should be visible.

There are a number of options for exporting an image from Inkscape including exporting the page or the drawing, but in this instance we'll use Selection (highlighted in blue, top right) so that only the bitmap is exported with no background etc.

In the Image size section, add the size you want your image to be.

The area highlighted in red allows you to name and save the image file to a location on your PC. Hit Export As then navigate to the location on your PC, and name the image file.

When you have finished navigating to the location for the file and naming it, the image has still not been exported from Inkscape. This sometimes confuses a few people because you'll need to hit Save in the navigating window, so its easy to think the image has been saved. For the image to actually be exported however, the Export button highlighted in Green should be clicked.

Tweaking The Image In Gimp


31/ This is the image in Gimp. The background of the butterfly is transparent, and the white is a background layer I added to highlight any blemishes.

All we really need to do to the image in Gimp is paint in any gaps we don't want. The area where the two halfs meet is an obvious example since the seam is visible, although there are also areas in the wings to fill in. Finally there are a few black spots that need erasing.


32/ This is the final touched up image ready to be used on other projects.


To use the butterfly image for the tutorial on creating gradients mentioned at the top of this page you'll need to duplicate your butterfly layer then create a silhouette similar to the one above. If it isn't clear why you need this take a quick look at the tutorial by following the link above and all will become apparent.

The techniques covered in this tutorial can clearly be used for much more than creating butterfly based graphics, particularly the bitmap tracing section. Also the fundementals of using the bezier tool will become a mainstay for many budding designers as they become more familiar with Inkscape, and use it do some of the tasks it does better than other software such as Gimp. If you've enjoyed this tutorial feel free to share and to come back for more.
Read More

Tuesday, 14 August 2018

Create An Infinite Reflection Effect in Gimp

By With No comments:

This is a quick and simple tutorial on how to create an infinite reflection effect in Gimp, using the Recursive Transform tool that is new to Gimp 2.10. In fact the underlying aim of this tutorial is to demonstrate how to use this new tool, whilst creating an infinite reflections effect as an example. Once you know how this tool works you'll soon see just how versatile it can be, and how it can open up creative possibilities for your own images.

To learn how to create an infinite reflection effect in Gimp follow these simple steps. Click on each image to enlarge if you need to.


1/ First go into Second Life and take a snapshot of your subject.


2/ Also take a snapshot of the rear view. Using a photographer's poseball will ensure the figure maintains the same position in both images.

Once you have the images you'll need to remove the background. if you're unsure how to do this there are three tutorials here on SL-Inspiration that explain different techniques. The links are given below.


3/ Open Gimp and add the first image.


4/ If the image is too large select the Scale tool in the Toolbox window (highlighted in red above). Click on the image and in the box that opens enter the new size for the layer.


5/ When the layer is scaled to size it may appear off centre, as in the image above. Simply drag it in position with the Move tool.


6/ add the second image to Gimp and follow the above steps to scale it. The rear view of the figure should be the top layer as its going to be the first reflection of the figure looking out at us (see the top image here if that sounds a bit confusing).

In a real mirror the reflections would almost mask each other, therefore we need to use a little artistic license in the spacing of the two images so both can be seen clearly. Also you might have noticed the rear view of the figure was taken slightly to the side to help visually explain the distance between it and the front figure.


7/ Hide the background layer by deselecting the eye icon to the left of it in the layers panel. You should now have just the two layers of the figures visible, both with their backgrounds removed.

Right click on one of the layers in the layers panel and from the drop down list select New from Visible. This will create a new layer with the figures merged as one image, whilst preserving the original layers.

If you prefer you can simply merge the two original layers, but this way, if anything goes wrong we have the original layers to fall back on.


8/ The layers panel should now look the same as the image above.


9/ Now we get to use the Recursive Transform tool. Select Filters > Map > Recursive Transform



10/ The above window will appear. The number of iterations will determine how many reflections we see. The default number of iterations when the window first opens is three, but here it has been changed to seven. Although this may not exactly be an infinite number of reflections, too many will just look wrong, so again a little artistic license is needed.

The Paste below option should be ticked otherwise the more distant reflections will appear on top of what should be the foreground reflections. (Toggle this option to see the difference).


11/ When you first make the adjustments in the Recursive Transform window nothing much may change. However there are handles that can be adjusted in the main image window (highlighted in red and green above). Generally speaking the handles highlighted in red will adjust the size and position of the recursions, whilst those highlighted in green will shear and taper them.


12/ After tweaking the handles a little this is what I ended up with. It does take a little trial and error, and it will be different for each image, but it is not difficult to grasp.


13/ A new background has been added to the image here.


14/ Since the image is going to be a reflection, it needs to be flipped horizontally. To do this select Image > Transform > Flip Horizontally.


15/ The image is now ready to be exported out of Gimp.


16/ for the final stage the image was uploaded to Second Life and added to a prim. Another snapshot was taken with the figure standing before the original image.

The set up here has been kept very simple so the basic concept of creating infinite reflections could be explained, along with the basics of how the Recursive Transform tool works. It doesn't take too much stretch of the imagination to work out how two reflection images could be uploaded to Second Life then juxtaposed to create a more convincing illusion of two mirrors reflecting each other. It is also easy to imagine different ways the Recursive Transform tool can be used, particularly to create Droste images. Enjoy experimenting with this tool and come back soon for more posts and tutorials.
Read More
Home About Calender Contact Advertise
Copyright © 2014 SL-Inspiration | All Rights Reserved. Design By Blogger Templates