Jump to content
John Rostron

Creating tiles using Affine, especially of Leaves

Recommended Posts

I originally took photographs of leaf litter on  a woodland floor to use as a background image for one of my woodland websites. Later, I thought it would be nice if I could create a tileable  image for this purpose. This explains the procedure. I am using images of leaves here, but the principle would apply to any discrete image with transparent background.

For this example, I collected about 15 leaves from a Guelder Rose bush in my garden. Now is a good time (November in the Northern hemisphere) because the leaves are a rich variety of colours The Guelder Rose included reds, purples, browns and yellows. 

Freshly gathered leaves may well be dry and are difficult to lay flat. My Guelder Rose leaves were OK, but I had curling problems with some Maple leaves (English Field Maple, Acer campestris). To flatten them sufficiently, I soaked them in water for about an hour and then laid them out on and between sheets of tissue to dry. They need some weight on top, but not too much. I used a few magazines for this. Leave them overnight to dry and flatten. They do not need to be totally flat or dry.

The reason for needing them fairly flat is that I create the image using a flatbed scanner. I lay the leaves on the glass plate and cover with a piece of thickish white card. This helps to flatten them and also provides a nice white background. I also apply some gentle pressure on the scanner lid whilst scanning to help flatten the leaves. I use a Canon MP630 scanner/printer and Vuescan for acquiring the image. After the image is saved, it is automatically loaded into Affinity Photo. Here is an example:



I can select each leaf one at a time using the Flood Fill Tool with the Add option and 20% tolerance. Many leaves will be selected at the first click, but a few more clicks may be necessary for others. Once I have a leaf selected, I cut it (Control-X on Windows, or the Mac equivalent). I use Cut rather than Copy since the gap tells me if any significant parts have been left behind, in which case I can cancel the cut.

Once I have cut out my leaf, I then select File > New from Clipboard. This then opens in a new window. Almost always this image need no further editing, but the opportunity is there if needs be. I can then export that image under a suitable name (Guelder Rose 01.png in this case). You need to save as .png  (or .tiff) since you need to preserve transparency.

I do this for the leaves on this scan and then repeat for the rest of the leaves. I am now ready to create my tile.

Firstly I create a new image of 800 by 800px ( more or less if you prefer). I then select the first batch of leaves (six in this case, Guelder Rose 01.png to Guelder Rose 06.png). Each in turn is placed on my image tile (File > Place). At this point I usually rotate the placed image arbitrarily and resize it to about 10-20% of the tile size. After the first set have been placed you need to make  a decision: do you want to proceed destructively or non-destructively? For the next stage you need to create a new pixel layer incorporating the images so far. To do this destructively, just pick Document > Flatten. This merges all your layers into one. Alternatively, you can pick Layer > Merge Visible. This merges all your layers into one, but leaves the other layers below. You may need to hide these. Personally, I use the destructive Document > Flatten.

You are now ready to make the first Affine Transformation. This allows you to to swap the left part of the image with the right part, along a line of your choice. Similarly you can swap the top and bottom parts. To use the Affine transform  pick Filters > Distort > Affine. This opens up a box that allows you to select your division lines as Offset X and Offset Y. I find it easier to select Offset Y first, and then Offset X. You can pick any percentage you like here, but I tend to start with 20% for each. Click Apply. This shows the effect of the Affine transform on a set of six leaves (I cannot remember the % setting here):

Before: 316446850_Tilingstep1.png.1b4312c15d8e828ca7ddefc331ff1031.png 

After: 1195760301_Tilingstep2.png.5a7d1c7d7ff73414c397a78986dd33b0.png

Some leaves have been split so that the leaves on the right  have the right parts missing, but they are now seen on the left-hand side. Similarly one leaf is split top and bottom.

We can now repeat the process, adding half-a-dozen more leaves, flattening the image and applying the Affine transform. This time I use 40%. We can repeat this, adding more leaves, to fill in the gaps. Subsequent Affine transformations can be 60% and 80%, but after the first few, I tend to use a split which brings any significant gaps to the centre. Here are a few intermediate steps in my tile:

1741293759_Tilingstep3.png.0168c7ccdad457930ecfb4f4431c3cde.png 1483995129_Tilingstep5.png.245c77626c9a100d7c48569d05ac399d.png

1722537543_Tilingstep7.png.5b0f721f16c5472f5ca31eb894e7711f.png 1912994709_Tilingstep9.png.3de955fb2342e462b9bcd27d53b01d4e.png

For the final image, I have enhanced the contrast a bit and added some sharpening. Here is the final image tiled with itself four times:


I will be putting some more examples of this under the Share Your Work part of the Forum.


Windows 10, Affinity Photo 1.7 and Designer 1.7, (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post

Link to post
Share on other sites
On 11/14/2018 at 7:53 AM, Mike.Reynolds said:

Hi John,

Have you thought of adding some other forest floor items such as the prickly green things and conkers etc? (I forget what they are called)

They'd fit in well with your leaves.


I kept this one simple, with one type of leaf. I will be posting some more examples, including mixed forest floor leaf-litter on the Share your Work pages.


Windows 10, Affinity Photo 1.7 and Designer 1.7, (mainly Photo), now ex-Adobe CC

CPU: AMD A6-3670. RAM: 16 GB DDR3 @ 666MHz, Graphics: 2047MB NVIDIA GeForce GT 630

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now