Friday, 15 December 2017

The Diamond Shaped Gradient

In this tutorial im gonna show you how to make a gradient made of diamond shapes in Inkscape with
the power of tiled clones.

Get the latest version of Inkscape (0.92.2) to make sure you have all the bugfixes !
I will use this effect to create a wallpaper for my desktop, so before we can start, i have to find out the resolution of my screen. In Windows you can do that by right clicking on the Desktop.
In my case the resolution is 1920x1080px.

Open the Document Properties (Ctrl + Shift + D).
Type in the correct pixelvalues for the canvas.
Remove the border shadow.

We will be working with white objects, so to make sure they will be visible, i change the backgroundcolour to something other than transparent and white, in my case: #d2e2e200.

Draw a rectangle and with the help of snapping make sure it fits exactly into the canvas borders.
Go to Object → Objects to Guides (Shift + G).

Draw a perfect square with the help of Ctrl and Shift.
Convert it into a path (Ctrl + Shift + C), select all four nodes with the Node Tool and hit the plus so that we end up with 8 nodes.

Make sure the aspect ratio is locked.

Now open the Transform Dialogue (Ctrl + Shift + M) and rotate by 45° to get a diamond shape.

Next we need to perform a bit of math.
I want my canvas filled with eight rows of diamonds on top of each other, so we have to divide the height by 8. 

1080 / 8 = 135

Type this number into the sizecontrols of the Select Tool.

Open the Fill & Stroke Dialogue (Ctrl + Shift + L) and change the Fill of the diamond to 'Unset'.
It will turn the diamond black.

Now go to Edit → Clone – Create Tiled Clones and click the Reset button to make sure we start with a „blank“ dialogue.
I want eight rows.
No pure black or white shapes and double that number of Rows because our gradient has an offset.
8 Rows + 1,5 for the extra colours outside the canvas x 2 for the Offset.
That means 19 Rows.

For the Offset we need a stair effect, which means for each column it has to go down by one square.

Thats 100% for the Shift Y Value per Column.

In the Colour Tab, click on the coloured rectangle and set it to pure black (#000000ff).

We want this black diamond to be white at the end of the Row, that means the 100% for the Lightness must be divided by 18 steps to go from black to white at 19 Rows.

So for Lightness type 100/18 = 5,556.

The amount of Columns we have to find out by trial and error - i go with 24 for now.

Before we can click 'Create', we have to rotate the diamond back into its square position.
So Rotate the diamond by 45° again, then hit Create in the Tiled Clones Dialogue.

This is what you will get:

Remove the clone that sits on top of our original path and delete it.
Hit Ctrl + A to select everything, then Group.

Rotate this Group by 45°

Now we can align the Group on the canvas area.

Thats the basic effect, but before we can export, we need to do one more thing.
If you zoom in real closely you will see the background shining through the diamond edges.

We will have to perform a little tiled clones trick.

Zoom in on the original diamond and select it inside the group by clicking on the shape while holding down Ctrl (or enter the group through the right-click menu).

Put guides around it and make sure 'Snap to Guides' is active.

Now with the Node Tool drag the middle node to the guides intersection.

Because all our other diamond shapes are still clones, they will follow whatever happens to the parent tile and close the gaps. But because of the z-order, it happens under the „hood“, only visible at the edges.

Leave the group by double clicking on a free space on the canvas.

Make your final adjustments of the group on the canvas, then open the Export Dialogue.
Make sure 'Page' is selected, choose your destination and export.

This is the final result.

Now we import our Diamond Shape Gradient into Gimp and make it better.

Use Colours → Colourise to give it your favorite tint.

A High Pass Filter sharpens the image and enhances the edges.

I used RobA's High Pass Filter, with a Radius of 14px, set to 'Grain Merge'.
(alternative download link)

You can also set up a second Diamond Gradient in Inkscape but this time with a gradient from white to black, instead of the Unset Fill (reset the value in the Tiled Clones Colour Tab to 100%).

Make sure the button 'Move gradient along with the objects' in the Tool Bar is on.
Otherwise your gradient will seem to vanish when you do the Rotation.

Imported into Gimp and put on top of our basic Diamond Gradient and set to Multiply to get rid of the white, it serves as a shading effect.

You can reverse the gradient by inverting the colours if you like.
Dont forget to play with the Opacity !
You can also customize the white to black ratio of the gradient with the Curves Tool.

With these b/w gradient diamonds you dont even have to make new ones in other colours, because

you can always use the greyscale image as a layermask to get any colour you like !

No comments: