Select objects of similar size in Inkscape

For the AlgoMech 2019 festival in June I created a new performative drawing piece, A Perfect Circle. The piece is about how we interface with computers that analyse our activities. It consists of a video and accompanying plotter drawings.

Making A Perfect Circle presented me with a few challenges. The make the video element I hacked together a couple of Processing scripts that did basic motion tracking by following a user-specified colour. It would draw these lines, creating new lines (instead of adding to an existing line) at each major turn and giving them a unique colour.

The next stage was to export those drawn lines to SVGs (or PDFs) so that I could export them to Inkscape and then a plotter. Fortunately Processing already has functions for exporting to SVGs. Unfortunately for me if I were to implement this as is suggested in the help file it would export both the drawn line and the background video as a still frame. I produced a very hacky workaround (with help from Ben Neal) which “works” but produces a few unwanted artefacts.

Before I go on I should probably explain what a plotter is as the unwanted artefacts relate to it. For this I will copy from the Wikipedia article on plotters:

The plotter is a computer printer for printing vector graphics. Plotters draw pictures on paper using a pen. In the past, plotters were used in applications such as computer-aided design, as they were able to produce line drawings much faster and of a higher quality than contemporary conventional printers, and small desktop plotters were often used for business graphics.

At home I have a Silhouette Cameo 2 vinyl cutter. When using this great Inkscape plugin I can bypass Silhouette’s proprietary software and send artwork directly to the cutter from Inkscape. Thanks to a pen holder adaptor I can replace the vinyl cutting blades with a pen and turn the vinyl cutter into a plotter 🙂

Back to the Processing sketch. The hacky code that I made produced the desired lines but also it had lots of additional single-node paths/dots at the start of each line.

Removing these wouldn’t be very easy. Using Edit > Select Same > Fill and Stroke or Fill Color or any of the other options wouldn’t work as it would also end up selecting the lines. I then had the bright idea to select objects based on their size. All of the dots had a dimension of 4.057×4.000px, so in theory there would be an option like Edit > Select Same > Size. However, this is not so.

After a discussion on the Inkscape forum I opened a feature request on the Inkscape bug tracker to select objects of similar size. One thing I added to this was the idea of a threshold. Using this you could select objects that were within n% of the size of the selected object. If you’ve ever used GIMP you would have seen a similar function in its fuzzy selection tool This could definitely be useful if you trace bitmaps and it produces a lot of speckles. I also added a mockup to show how it could be applied to other options in the Edit > Select Same menu options.

Anyway, at the moment this exists as a feature request. I think Inkscape is concentrating on delivering version 1.0 of the software so I don’t expect to see this implemented any time soon. As with anything in the land of open source, if you’ve got the skills to do this please contribute!

In the end I used fablabnbg’s Inkscape extension to chain all (or most) of the paths into one big path. This made selecting the dots easier as I could just hide the big path(s) once they were chained together.

After that it was a simple case of sending it to the plotter!

Starting off Simple

I’ve been doing quite a bit of messing around with Alchemy. Whilst in search of solution for a problem in Blender I came across a rather awesome time-lapse digital painting from an upcoming Blender Foundation project, Durian. Not only was I blown away by the skill of the artist but also by the software that he uses. I’m an open source nut so was really glad to see him use GIMP and other open source software to produce his piece. One particular piece of software that stood out to me was Alchemy.

If you’ve watched the video already you’ll have seen how he used that program to create chaos from which to build something else from. I was a bit skeptical at first, thinking that GIMP and Inkscape can do this already and with many more options. However, upon using it I could soon see the benefits of using this program. As the website so clearly states, it’s not meant for finished pieces (although some have used it to create finished pieces). It’s meant to help generate ideas, to sketch, to just go crazy on!

After just a week of using it this was some of the work that I had created in it

Lunchtime Butterfly (by hellocatfood) Stop Hitting Yourself (by hellocatfood)

I soon began to think more about what I perceived to be the point of the program. Typically, when I sketch my marks start off very light and whispy. Then, I draw over these whispy lines with more confidence until the original marks either become thicker and darker or are simply overshadowed by the newer marks. With practice you would then expect one to be more confident with their mark making, to the point where there are no more whispy lines, just sharp, clear marks.

Also, after many hours of studying you would expect one to make marks that represent any form in as few marks as possible. One important lesson I learnt at university is that you should only add detail where it’s needed. Spending 100 hours on an art piece may be personally satisfying but when people wont notice or have the time to appreciate that amount of detail why bother. In another situation, when you have a deadline looming, do you really have the time to add insane amounts of detail?

In time I feel I should be using this program to help develop this skill and my confidence as an artist. Drawing intricate layered pieces may look impressive but personally I know part of the reason I use that style is lack of confidence. I have put a suggestion to the developers to add a feature to Alchemy (and I’m slowing learning Java) that can help facilitate this by restricting the amount of shapes you can have on screen, but until then I’ve been doing a few tests of my own. Partly born out of frustration I’ve been trying to do portraits of myself using as few shapes as possible, in this case four shapes. As there are soooo many different recognisable features about our own individual faces it would be quite a challenge to pick just four features or shapes.

Working from memory I drew these portraits last night.

Portrait 1 Portrait 2 Portrait 3 Portrait 4 Portrait 5

On a side note the good thing about Alchemy is that it can record a snapshot of your drawing to a pdf at timed intervals. You can download a zip of all of the pdfs if you really wanna see how I did it.

Admittedly the first portrait probably has six shapes (open the pdf up in Inkscape to find out) but that was because I accidentally used a white shape on a white background. Alchemy has no undo function so I just painted over it in black.

I slept on it and came back with a few new ideas. Do you really need to draw someone’s head or hair? That depends on what their most recognisable features are. I am quite well known for my hair, but I proved last year that even without it people still knew who I was *shock*. So, maybe it’s not that important. As a test for yourself, try taking a portrait picture of yourself. Open that picture up in your favourite picture editor (I use GIMP (duh)) and apply the photocopy (or equivalent) filter. If needed erase the background until you have just your facial features.

With Hair and clothes

With Hair and clothes

Without Hair and clothes

Without Hair and clothes

Is it still recognisable?

So, I tried again to draw myself using only four shapes, but this time only my facial features. Here are my results (same four-shape rule applies).

New Portrait 1 New Portrait 1
(download zip of pdfs)

A little more recognisable? Four shapes might be a little bit too restrictive but you only really learn from challenging yourself. Why not try making the cursor invisble when you draw (press H) or draw “blind” (Affect > Draw Blind). Going back to the aims of the program once you feel more comfortable using very few shapes let yourself go a little bit and maybe use 10 or twenty shapes. Here is my final piece, starting with simple shapes, then going over with more detail

Final Portrait
(download pdf)

Some more work in progress

This piece was originally entitled Krap. It started out with the text and was a reflection on my mood. This I felt was quite negative so I added the faces and am now transforming it into a portrait of a man who loves music!

A reflection of my mood and also my first of this style to be drawn directly into the computer! It was a lot easier than I thought. In Inkscape I just pressed Ctrl + L to get rid of all of the extra nodes then smoothed it all out. This piece will make a lot more sense soon!