Easy Way to Automate Photoshop with Variables (Part 3)

Easy Way to Automate Photoshop with Variables (Part 3)

In this post we will go one step further in our exploration of one of the most powerful features in Photoshop: Variables and Data Sets. If you have missed the first two parts read them from here: part 1, part 2. This time we will use Pixel Replacement variable combined with Text Replacement variable. I will provide you a template which you can download and follow along.

Download Old photo with frame template. It is direct download and you will download the PSD file.

In this tutorial I will use images from depositphotos. Another information for you that the template is actually created while developing Old Photo actions which you can try or buy from Adobe Add-ons or my online store Photoshop Plus.

Why to use Text Replacement variables

There are many situations where Text Replacement variables can be very handy. You can, for example, create a postcard template and use Text Replacement variable to change the country, city name, or to display the year and date of event, travel, vacation... You can also add caption, header, footer or even an entire paragraph of text with heading, description, price and so on and so on.  There are and many other uses like decoration for wedding photos what we will create in this post or to automate creation of wedding invitations which I have published as a paid product.

How to combine Pixel Replacement and Text Replacement variables

You can create your own template or downloaded provided template from the link above. Open a template in Photoshop. I will work with Photoshop CC 2014 which is the latest version. If you have your own template, then ensure that you have prepared one layer for a photo (pixel based or Shape layer) and one Type layer. I am using Bickham Script Pro Regular 48pt font. You can use any other font or to change it in the template which is provided. Choose font for which you think is most appropriate and style it if you want using Layer Style. Important is to mention that same font and same style will be applied to text that we are going to enter for Text Replacement variable.

Step 1 Assign Pixel and Text Replacement variables
The first task is to go to Image > Variables > Define. In Variables dialog choose: Text from the Layer: drop-down list. If you have your own template, then select any of Type layers you have in the template. There is no limitation and you can assign as many Text Replacement variables as you want. On the other side you can have hundred Type layers and to assign Text Replacement variable only to one of them.
Choose text from Layer drop-down list

Click on Text Replacement to appear checkmark and you are done. Note that asterix (*) appeared next to Text as an indicator that layer has variable assigned. You can type a name for this variable in the Name: text field.
Click on Text Replacement to appear checkmark

Now go and choose: image from the Layer: drop-down list. Click on Pixel Replacement to appear checkmark. From the Method: drop-down list choose: Fill.
Choose Fill from Method drop-down list

Click on the Next button on the right side of Variables dialog and we are done in this step. We have assigned variables to two of our layers in a composition.

Step 2 Choose an image and type text for replacement
At this point you should be seeing Variables dialog slightly different from previous one. Go and click on "download" button to create Data Set.
Create Data Set

Pixelvariable1 should be selected by default (blue background). Click on Select File button and navigate to image you want to use. In Open dialog just double click on photo which will be loaded. Note: if your photo has Camera Raw or Lightroom adjustment applied, then you should see Camera raw dialog, otherwise with JPG, TIFF, PSD (even layered) files you won't see any dialog. By the way, you can use and RAW files which are not adjusted and quickly adjust the photo in Camera Raw plugin. Click on Preview on the left side so you can see image in the layout.
Click on Select File button and navigate to the image

Now go and click on TextVariable1 to select it. Type in Value: text field whatever you want. If you do not see your new text substituted in the template, then uncheck and check again Preview on the right side of the dialog. That's it, but stay with me because we are going to create more Data Sets.
Type text for Text variable substitution

Step 3 Create more Data Sets
Now we are going to create more Data Sets and to use different images. We can also type different text. The main benefit is to quickly get the job done and to create reusable template which can be used over and over again. With the next client you can use different images and type their names or event name, for example.

You can create 50 Data Sets with 50 different images and 50 different text messages and to export them in a minute. The frame and the effect will be the same for all exported images in this case, but it can be different frame and different effect. There is more that can be done using Visibility variables which can bring more flexibility, but for now lets keep it extremely simple.

So, click on "download" button to create another Data Set and repeat process as in the step 1. After clicking on "download" button you should see Data Set 2 in the text field next to data Set:.
Create second Data Set

When you are done with the second Data Set go and create a third one.

At the end of the process, click on OK button to confirm and exit. You will not see any change in your template, but thats ok, everything is ok. Save your file from File > Save or Save As and I am going to explain you what you can do with a saved template which has defined variables and Data Sets.
Click OK button to confirm and exit

What you can do with the template which has Data Sets

Now that you have created Data Sets which are actually instructions which images to place and what text to use to substitute existing on Type layer, you have several options.

When you save the template with Data Sets created, Photoshop will store data and it knows which images and text to use. Path to images is saved in Data Sets and next time you open a template you can use Image > Apply Data Set... to showcase compositions to client for example and offer to choose which compositions (image, frame + text) to deliver to him. Note: images must be at exact same location on your drive as when creating Data Sets in order everything to work as expected.
Preview data sets from Apply Data Set dialog

You can also export Data Sets (read from here how-step 11). You will notice that there is an option to choose which particular Data Set to export and option to export All Data Sets. What if the client choose 10 from 20 created compositions? Simply duplicate template and delete Data Sets that you do not want to export. Go to Image > Variables > Data Sets. Choose set from the Data Set: drop down list and click trash icon.
Choose data set then click on trash icon to delete it

Another thing that you can do is to speed up process by naming files (actually renaming) as explained in steps 1-3 in the post: Easy Way to Automate Photoshop with Variables (Part 2).


If I have done my job correctly, with some interest from your side, you should be able to save time with knowledge from the previous 3 posts which has Variables in the title. That's not all, there are more options associated with variables and the ability to combine them with actions for special effects and distortions which are usually applied using Smart Objects. As already mentioned in a previous post, variables cannot be assigned to Smart Object layers, but no worries, we can use actions to batch process exported files using variables. Stay with me, there is more to cover.

All posts in this mini-course
Easy Way to Automate Photoshop with Variables
Easy Way to Automate Photoshop with Variables (Part 2)
Easy Way to Automate Photoshop with Variables (Part 3)
Easy Way to Automate Photoshop with Variables (Part 4)
Easy Way to Automate Photoshop with Variables (Part 5)
Easy Way to Automate Photoshop with Variables (Part 6)
Easy Way to Automate Photoshop with Variables (Part 7)
Why and How to Combine Text/Pixel Replacement Variables With Visibility Variables in Photoshop

Product used in this tutorial:
Adobe Photoshop CC 2014

Photoshop Help / Creating data-driven graphics


Popular posts from this blog

Free Puzzle Pieces Actions For Photoshop and Elements

How to Change Artboard Size in Adobe Photoshop

Old Weathered Vertical Wooden Planks Free Image