Make Match Attax / Top Trump Cards Using Photoshop Mail Merge.

by Stravides in Craft > Printmaking

17672 Views, 18 Favorites, 0 Comments

Make Match Attax / Top Trump Cards Using Photoshop Mail Merge.

Stravides Junior.jpg

My son loves his collectable playing cards and I thought it would be nice for him, and his football team, to have their own set of playing cards, similar to the Topps Match Attax cards you can buy, personalised with their own stats and images.

I did not want to make multiple files and edit each one, I wanted to make a template so that it could easily be re-used and all the main editing done once.

I thought it would be a good idea to use the Variable & Data Set functionality of Adobe Photoshop CC.

Prerequisites and Software

I used the following software to create this Instructable:

In order for you to follow along, I have included the template files I used for this project.

There are no mods or addons required to replicate this Instructable so if you have the above - you are good to go.

Downloads

Process Outline

Whether you use the template provided, or create your own the process is very similar to any standard mail-merge functionality.

In this Instructable we are going to:

  • Modify my template and "finalise" its design.
  • Create some merge-able content in Photoshop via variables
  • Create a data source file
  • Merge this data into Photoshop.
  • Export the final images to a directory which can then be printed.

​So What’s This I Hear About Photoshop Being Able to Mail Merge...?

There is a huge amount of functionality in Adobe Photoshop, and one such feature is the ability to make “Data Driven Graphics”. Sounds fancy - Well that’s what Adobe wants us to call them, so who am I to argue on that one.

There are 3 types of variable that Adobe Photoshop uses.

  • Visibility - This variable type shows or hides the layer.
  • Text Replacement - Replaces the text in a type based layer.
  • Pixel Replacement - Replaces the pixels from another image file.

We will use all 3 types in this project to show how each one is used.

Visibility can be used in conjunction with either of the other 2 types, or on its own. However, Text and Pixel cannot be used on the same layer.

So you can have Visibility and Text variables on a single layer, but not Text and Pixel.

Let's Get Started.

writtenstats.png
layers-skillvalue.png

When creating the template, I made sure that any image/text/variable that I wished to change was on its own layer. This way I would not affect any other areas on the playing card.

To start with, take some time figuring out which stats you wish to show, what values you wish to display, this will give you an idea of how many layers you need.

Open the template in Adobe Photoshop and you will see that the template I provided has a number of Layers and these are arranged into Groups to make things easier for me.

I recommend trying to be as organised as possible with the layers as things can quickly get out of hand when It comes to the number of layers required.

Name the layers with the end result in mind. i.e. skill1, and skill1Value - adopt some naming convention as Namevalue is not the same as NameValue.

I tend to use the camelCase convention for my variables, so in the previous example this would be nameValue.

Edit the graphics and background layers to suit your design, I have included 3 background colours and 2 players/halos in the attached zip file above.

Once you have the desired look on your card, we can move onto the variable aspect of the cards.

Create Layers for the Variables.

lowerstats.png
layers-skillvalue.png

As we have mentioned above there are 3 variable types visibility, text and pixel.

A single layer is either an image or a type based layer.

The type based layer can only have the Visibility and Text variable types associated with it and the image types can only have the visibility and pixel variable types associated.


Note - We need to create the New layers above the Stats Artwork Layers.


For text variables create a new text string using the horizontal or vertical type tool. This will create a new layer with the text on it - remember to rename this layer so that it makes sense when you are adding variables.

Do not rasterize or flatten these layers as you will need them to be editable later.

We are only creating the placeholders at the moment, not the actual values.

I have created the pixel variable layers for BGColour, Player Here and Player Blur

I have created a number of text variables skill1Value - skill6Value, skill1-skill6, name, value etc.. each one is on a separate layer.

You can select a number of Layers and Group them (CTRL-G on the PC) you can then rename this group to a more logical name.

I have included the Adobe Photoshop PSD for this stage also.

Create the Variables in Adobe Photoshop

defineVariable.png

The scenario I am going to demonstrate is only 4 records.

  1. Player A, Green Background, Left Facing Images - stats
  2. Player B, Orange Background, Right Facing Images - stats
  3. Player C, Blue Background, Left Facing Images - stats
  4. Player D, Orange Background, NO player images - Changed Stats

So lets start adding the variables - highlight the BGColour layer.

from the menu select

Image > Variable > Define…

this will present you with the Variable definition screen.

Make sure that the layer is BGColour

Select the checkbox next to Pixel Replacement and enter the variable name BGColour.

This sets up the Layer BGColour to be represented by the variable BGColour .

Change the Method to As Is


From this screen you can use the left and right icons to scroll through the other variables, or pull the drop down to select the variables.

As you scroll through the variables the available variable types change with the layer type.

We next change the playerHere and playerBlur layers to allow a change in the pixel image AND the Visibility.

The variables should be blurVisible & playerBlur and playerVisible & playerHere.


Continue through the rest of the layers adding the correct variable types and giving the correct names.

An asterisk will appear beside the layer name once you have added a variable to a layer

Create the Data Input File.

csv.png
utf8csv.png

You should now have a complete list of variables that you wish to merge with the document.

We are going to use Excel to create the initial upload file.

Headings.

We are going to use row 1 as our headers - or voariable names. So, place the variable names across the columns in the same convention you named the layers.

In my case this would be

name defenceValue attackValue playerValue .... blurVisible bgColour playerHere playerBlur


Data

We can now add some data to the rows below this - remember to use the correct path for the images. The Photoshop import functionality does not like blank fields, so if you wish to have a specific field or graphic left blank then you should enter " space into the field. That's a double-quote followed by a space.

Once finished save this file as a comma separated value file (UTF-8 .CSV)

Using Notepad++ you can see result would be something like the image attached.

The headers on the first line, each field separated by a comma. The data on the following rows, also each field separated by a comma.

Create the Data Set

createdatsetbutton.png
createdatset.png
BGorangedataset.png
import.PNG

Ok so now here's where the magic happens. We have created the template, the additional graphics, the input file, prepared the layers defined the variables. Let's create the Data Set.

Within Adobe Photoshop, use the menu and go to:

Image > Variables > Data Sets...

Press the Import button

Press the Select File button and navigate to the CSV file and press Load

Make sure that the Use First Column for Dataset Names as is selected.

Press OK

If all goes to plan and you have managed to call the fields and the input file variables the same then you should have 4 new Data Sets Named Player A - Player 0.

If you use the < > arrows you can navigate the 4 images and check that they match the scenarios we was expecting.

  • Player A, Green Background, Left Facing Images - stats
  • Player B, Orange Background, Right Facing Images - stats
  • Player C, Blue Background, Left Facing Images - stats
  • Player D, Orange Background, NO player images - Changed Stats

Export the Files.

export.png
exported files.png
Stravides Junior.jpg

We've done all the hard work time to finish up and create our cards.

From the menu select

File > Export > Data sets as Files

You will then be prompted to complete the export screen.

Press Select Folder Button and choose where you wish to store the new cards.

Choose All Data Sets from the data sets field and press OK to export

You should now have an individual Adobe Photoshop PSD file for each player in your input file.

Printable Sheet

As an added bonus I have included a further couple of files - specifically an A4 Landscape template to import the images we created in the previous steps. (suggest you create PNG or JPGS and import them.)

I have included the xls file also - have fun creating - again I'd love to see what you do with this instructable - post it in the comments...