Back to Facial templates development page

Examples of creating facial templates

Creating a basic facial template

Let's create a facial template where a face from a user’s photo will be inserted into a certain area using the facial points: the centers of the eyes and the corners of the lips. You can download the artwork for this template here. The result of this lesson can be downloaded here.

Original photo Photo processed with the template
Step # 1

Launch the Template Creator and wait for Photoshop to open. In the Template Creator select Create Project from the File menu.

A New Project window will open. Select the Face template type, Universal Orientation and save the project. The Template Creator will generate a PSD file with the necessary template structure.

Step # 2

Now go to Photoshop. You can see that the Template Creator has generated a PSD document with the necessary layers arrangement, so you can start working with your template

You must be familiar with the template structure: it consists of subgroups of layers, and a smart object of the user photo region. As this template has universal orientation, the subgroups of layers and the smart object are positioned on the top level of the PSD document.

As a reminder, the subgroups of layers and the smart object of the user photo region can be positioned in any arbitrary order that you may need for your particular template.

In this particular case we need only 1 subgroup with a graphic layer positioned above the face region. So we can delete the other two subgroups as useless.

Step # 3

Place the image with the robot head (can be downloaded here) into the graphic layer subgroup.

Adjust the canvas size to the size of the artwork. Use the Crop tool to trim the excess canvas.

Step # 4

Let us now position and scale the smart object of the face region.

When scaling the face region with the transform tool, always keep the proportions of the smart object. To do so, click the "Maintain aspect ratio" button (see below).

Scale and position the smart object. After you have tested your template using different test photos, you might need to go back to this step and adjust the smart object size, position and rotation.

But now, when you are satisfied with its position, head to the next step.

Step # 5

Go to the smart object of the face region. To do so, double-click on its thumbnail in the layers list.

You must be familiar with the structure of the smart object of the face region, so let’s proceed to correction color.

The point is that this particular template inserts faces from user photos into the head inside the template. The skin tone of the face (head) inside the template can be very different from the skin tone of faces in user photos. If we leave things as they are and process a random photo with a template, the result can look like this:

Original photo Photo processed with the template
without correction color.

To avoid such problems, you should use correction color - it will bring face skin tone in a user photo to the shade found in the template.

Go to the main document and use the Eyedropper Tool to pick up a color from the head a user photo will be inserted into.

Then go back to the smart object of the face region and use the Fill tool to fill the Correction color layer with that color.

The correction color layer will overlap the face scheme and the sample user photo. To be able to make further edits to the template, move the layer down under all layers.

The arrangement of layers inside the smart object of the face region does not affect anything except the convenience of working with the smart object.

Save the changes you’ve made to the smart object and close it.

Step # 6

Go to the Template Creator and reparse the PSD document. As soon as the document is reparsed, go to user photo region filters (learn more about the ‘Filter settings for User Photo Region dialog’ here).

Double-click on the user photo region to see the list of filters applied to it.

As we can see, there is the Face insertion filter applied to the user photo region. This filter is added automatically to the user photo region in facial templates or if you add a face region to a template.

The value shown in the ‘Correction color’ property indicates that the Template Creator has successfully retrieved data about the correction color that we specified in the smart object.

In case you need to change the correction color, go back to the PSD document and select another color in the smart object. Then save the changes you’ve made and reparse this smart object layer.

Close the Filter settings dialog and process several test photos. The result should be similar to the example shown at the beginning of the lesson.

Original photo Photo processed with the template
without correction color.

If the result is different from what you expected, you can always go back to any previous step and make edits. Then reparse the specific layers or the whole PSD document.

The result of this lesson (resulting template) can be downloaded here.

Creating a facial template with dynamic masks along facial contours

In this section we are going to cover the algorithm of making a creatively different facial template.

Original photo Photo processed with the template

As it appears from the example given above, this template is a facial type, as only facial templates let you control precisely the size and position of the face in relation to the canvas. It is quite clear that we need a mask for each face region in this template. A mask should be used to insert only faces, not entire user photos.

You can add masks to face regions using one of the methods below:

  1. Mask each face region manually, using cut-and-try approach to find a universally applicable mask shape.
  2. Use the Template Creator to build dynamic masks along facial contours.

You can learn more about dynamic masks here.

The second method is preferable as it is way more accurate (a mask is always built automatically using specific facial contours). Besides, it lets you avoid doing routine work.

Now it is clear how to implement the creative idea of this template: it is necessary to build a template with multiple face regions, with dynamic masks applied to each of them along the facial contours

Let’s get started!

Step # 1

In the Template Creator select Create Project from the File menu.

A New Project window will open. Select the Face template type and Universal Orientation

Save the project and wait while the Template Creator generates a PSD file with the necessary template structure.

Step # 2

Now go to Photoshop. You can see that the Template Creator has generated a PSD document with the necessary layers arrangement, so you can start working with your template.

To implement our creative idea we’ll need quite a few face regions (about 10 of them). The canvas automatically created by the Template Creator will function as the white background (it is visible in some places in the resulting template).

Let us now adjust the structure of the PSD document. Delete three unnecessary subgroups of graphic layers.

Step # 3

Go to the Template Creator and reparse the PSD document. Our template is semi-finished at the moment, and we can try processing a test photo.

The result that we got is quite expected. The test user photo has been positioned using its facial points and it has not been cropped. But, as we said before, we need it to be masked (cropped) along its facial contours.

Step # 4

Double-click on the user photo region thumbnail to see the list of filters applied to it.

As we can see, there is the Face insertion filter in the list of applied filters. This filter is added automatically to face regions by the Template Creator.

Set the ‘Face’ value in the ‘Mask’ property.

Setting this value will let us hide everything beyond facial contours from user photos. Confirm the changes and close the filter settings dialog.

Step # 5

After we've adjusted dynamic masking of the face region, we can check the result using a test photo.

The result is not bad. However, since our template combines multiple photos, it would be great to feather the edges of facial contours and make the mask a little bit ‘closer to the face’. To do so, open the Dynamic mask generation settings dialog.

To open the dialog, right-click the face region and select the corresponding item from the context menu.

This dialog lets you configure dynamic masks settings. Values set in this dialog affect all filters regarding face eroding and figures for a given user photo region.

Select Face Mask, then set Eroding Width to 10 and Smooth Radius to 15. Eroding Width determines how close image borders should be drawn up to the figure. The meaning of the Smooth Radius parameter should be clear from its name.

These settings let you make a dynamic mask ‘closer to the face’ as well as make its edges smoother. You can experiment with the parameters to find even more suitable values, in your view. Confirm the changes and process a test photo to check the result.

Well done! Let us now go to Photoshop and address the composition of the template.

Step # 6

As we've already said, we’ll need about 10 face regions to implement our idea. At the moment, the template contains only one face region, for which we’ve enabled a dynamic mask along its facial contours and configured its parameters. Now we need to add 9 more face regions. Of course, we could do this using the Insert menu in the Template Creator, but this method has some shortcomings.

The point is that if you add face regions using the Template Creator, you will get new regions without any added filters and configured settings. In this particular case, all 10 face regions should have the same settings regarding facial contours eroding. It is not a good idea to do quite a lot of extra work configuring the parameters for each of the face regions manually. That’s why we will create copies of the existing smart object of the face region right in our PSD document. All clones of this smart object will inherit the filters and face region settings in the Template Creator.

Right-click the smart object layer to open the context menu and choose ‘Duplicate Layer’.

Repeat this operation until you have 10 smart objects of the face region in the PSD document.

Step # 7

As soon as you've added all face regions into your PSD document, it is necessary to position and scale them.

Please remember that when you work with the Transform Tool, it is very important to keep the proportions of the smart object. This will keep the facial points correlation safe. You can enable it by clicking the Maintain aspect ratio button once the Transform Tool is activated. Check if this option is enabled everytime you are going to transform the face region smart object.

Step # 8

Arrange the smart objects in the PSD document in a way that suits you, then reparse the PSD document in the Template Creator and process several test photos.

Original photo Photo processed with the template

If the result differs greatly from what you see here, you can always go back to any previous step and make edits. Besides, you can download the ready-made sample of this template and compare it with the result you got.

Creating a facial template with custom facial marker points

In previous lessons, we looked at examples of facial templates where standard facial points were used to position the face. Now we are going to create a template where a face from a user photo gets inserted into a specific area using manually selected facial points. Along with that, we will try to preserve the main facial features from the user photo. The artworks that you’ll need to create this template can be downloaded here and here. The resulting project is available at this link.

Original photo Photo processed with the template
Step # 1

Create a new project with the "Face" template type. You can refer to this section for more details about how to create a template. After you have created the project, go to Photoshop and edit the layers. Place this image into the Graphic Layer 1 group above the Face Region smart object. You can delete other layers, as you won’t need them.

Step # 2

In order for the image to completely cover the canvas of the template, we need to resize the canvas vertically. The easiest way to do this is to use the Crop Tool in Photoshop.

Use the Free transform mode (Ctrl + T) to position the Face Region so that it fits nicely within the artwork. To position the face region conveniently, you can temporarily reduce the layer opacity, or place the face region smart object above the graphic layer in the layers panel.

Before transforming the Face Region, smart object, be sure to check the "Maintain aspect ratio" box.

Go back to the Template Creator and reparse PSD.

Step # 3

Let's move on to dynamic positioning of the face in the template. We’ll process several photos and check the results:

As you can see, the faces do not always fit well into the template, and some of the face features look unnaturally large. This happens due to the fact that the photo has been positioned using standard facial points:

Due to anthropological diversity of human faces, facial marker points used to position a user photo are of different size and are positioned differently in different faces. This, of course, affects the final result of processing. That is why it makes sense to determine the facial marker points manually - this will let us position user photos in the template with more accuracy.

Open the face position editor. To do so, double-click the “Face region” to open the filter settings dialog, select the Face insertion filter and click Position (Click to edit).

The face position editor is almost identical to the sticker position editor. The only difference is that it does not contain options for determining the sticker center and its size.

In order to select marker points correctly, we need to understand what facial features, available in the template image, can be used to position a face from a user photo.

As for the current template, it is quite clear that the only available face features are the ears and the face contours. Besides, we need to insert the whole face into the template, and not some particular face features. That is why the most convenient thing to do is to position a user photo using points placed along the face contours. To do so, select 4 central head points and 2 more additional points on each side of the previously selected ones for more accurate positioning.

To select the marker points more conveniently, we recommend that you turn on the visibility of the graphic layer via the Import menu.

It should be understood that individually selected marker points will be bound to the current position of the user photo region in Photoshop. This can lead to incorrect positioning of a user photo. For more accurate positioning, you need to adjust the position of the user photo region according to the selected marker points, and reparse the layer after that.

Before correction After correction

As you can see, in the "After" image the location of the selected marker points coincides with their actual location in the face on the graphic layer.

Finally, we have significantly improved the result:

Before all adjustments After adjustments
Step # 4

To make a face from a user photo blend well with the black and white color scheme of the template, add the Desaturation filter to the user photo region. Besides, since the skin tone of a face in a user photo may differ from that found in the template, we also need to add a correction color to the smart object of the user photo region in Photoshop, choosing the most suitable color tone found in the template artwork. We used the #d6d6d6 color for this template.

You can read more about adding correction color here.

Original image Before color correction After color correction
Step # 5

As we have said before, we also aim at preserving the main facial features from the user photo. To do so, we’ll apply an inverted dynamic mask based on the face to Graphic layer 1.

The result of applying the dynamic mask

As you can see, the mask has cut off some graphics in the forehead. Besides, the borders of the mask (transition between the graphics and the user photo) are too sharp.

First of all, let’s smooth the borders. Go to the Dynamic mask generation settings dialog and change the Smooth radius value to 3 (Параметр Sizes in percentage: True).

The result of changing the smooth radius

Changing the smooth radius helped us achieve a fairly soft transition at the mask borders. However, this resulted in new artifacts looking like semi-transparent reflections along the facial contours. To get rid of them, we need to change the eroding width value. Values between 6 and 7usually give the best results. In this case, we’ll use a value of 6,5.

The result of changing the eroding width value

n some cases, traces of the original user photo reflections may appear at the mask borders in the processed photo, or some hair covering part of the face may become visible. To smooth out these artifacts, we recommend applying another face mask to the user photo region, but a non-inverted one this time. Since it will have the same settings that we’ve specified earlier, but in the mirror image this time, this will help us hide most of these artifacts.

Before After
Hair near the left eye
Hair near the right eye
Some reflection of the original layer of a user photo near the beard

Step # 6

After we have changed the values of eroding width and smooth radius, a semi-transparent area became visible in the forehead in the graphic layer. It partially hid the tree trunks and made the picture look worse.

Hidden part of the graphic layer

To fix the problem, we need to copy Graphic layer 1 to a new group of layers called Top and then edit it in such a way as to leave only its upper half and remove the background near the head as much as possible, leaving only the tree trunks with a very smooth transition to transparency. A ready-made layer is available at this link .

If we place this layer above all other layers, it will hide all the artifacts caused by our previous actions.

The result of adding the Top graphic layer

As you may have noticed while working with the template, some user photos have different lighting problems. You can try fixing the problem yourself using filters.

On the left – before applying the filter; on the right – after applying the filter

Process a few test images with the template. The result must be similar to what is shown below:

Original photo Photo processed with the template

The resulting project is available at this link.

Back to Facial templates development page