Sports Photo Automation 7 – Using CSV Data
What CSV data is for
Sports Photo Automation can use CSV data to customize the compositions on a per image basis. CSV functions include the following.
- auto replace text
- auto scale text
- specify a background (overrides the default choice)
- specify the output file name (overrides the default naming)
- run photoshop actions on the composition
CSV files are typically setup in a spreadsheet program such as Excel on Windows or Numbers on Mac. There is also a really good free office suite called Libre Office that contains a spreadsheet program called Calc. That is what we use for creating CSV data. You can download Libre Offic at https://www.libreoffice.org/.
CSV Image Data Example
Basic CSV Layout
Important: The spreadsheet must be saved in .csv file format
Only use the columns you need – For example, if you are only replacing text in one layer with no resizing, the you only need column A for the file list and column B for the text layer.
Column A – Defines the source file list. If you are doing multiple images per template then add those in separate columns labeled Player 2 File, Player 3 File, and Team File.
Row 1 – This is the header row. It contains the “commands” for Sports Photo Automation to use (layer names, resize methods, etc.). These DO NOT need to be in any specific order.
Data Section – This is everything from below row 1 and right of column A. This contains the data the Sports Photo Automation will use.
Column A – Image Processing List
Column A doesn’t need any header assigned because that column much be used for the specific purpose of creating the main batch file list. You can add a header to column A if you want but it will be ignored by the software.
For player images or memory mates, column A MUST be used for the Player 1 layer group.
If you are only adding team images to the template and no players, and the template is setup with a team layer group only, then column will be used for the team images. All of the files in column A will dropped into the team layers. However, if the template has both a Player 1 image and a team image then column A will default to the player 1 layer. So for memory mates, Column A must be for the players. The team files can go in any other column (column B makes the most sense though).
Also, if there is no Player 1 layer group then it won’t process for any players, even is there are groups for players 2 and 3. This is important to know because if you create a template with multiple players, you can’t delete player 1 and decide to use the player 2 group unless you rename the group and all layers in the group from player 1 to player 2.
Memory Mate and Multi Player Images
For memory mates and multi pose images, you can add up to 2 additional player images and 1 team image.
When Processing, all of the player and team images must be in the same source folder.
The header names must be Player 2 file, Player 3 File and Team File. Add the name of the image files into the cell data. Adding the file extension is optional id the file is jpg, tif, png or psd. For those formats it will work with or without it. However, if you have images with the same name but different formats in the source folder (IMG_1234.jpg and IMG_1234.tif) then you will need to add the extension so it knows which one to use. Also, for other formats such a raw .cr2, you would need to add the extension in the CSV data.
Auto Text Replacement
To auto replace text…
Add a column header for each layer you want to replace text. You can replace text in a few or as many layers as you want.
The column header name must match the name in your PSD file (it is case sensitive). The example on the right is just an example, you don’t need to use the same layer names as the example.
In the data section, add the text that will be replaced for each image in each layer.
Text Replacement Spreadsheet format
Auto Text Scaling
Auto text scaling is optional. If you don’t add this column or leave the cells blank then you can still replace text but not resize it. One example of when you may not wan to use resizing would be jersey numbers if they are either 1 or 2 digits. You way not want the 1 digit numbers stretching to match the template layout that has a 2 digit number.
How to auto resize the text in batch…..
Add a header starting with “resize-” followed by the Layer Name that will be auto scaled. In the data section, add the scaling method of X, Y or A. The scaling methods are as follows.
Note: This will not add an angle to you text. Use this is you text is already at an angle. Sports Photo Automation will automatically determine the angle of the text so it can scale appropriately.
XM – Scales horizontal – It works similar to X mode, except it will only resize if the new text is longer than the original text in the template. If the new text is shorter then it will not scale at all.
YM – Scales vertical – It works similar to X mode, except it will only resize if the new text is longer than the original text in the template. If the new text is shorter then it will not scale at all.
AM – Scales angled – It works similar to X mode, except it will only resize if the new text is longer than the original text in the template. If the new text is shorter then it will not scale at all.
Text Scaling Spreadsheet format
Additional CSV Customizing Options
Additional CSV Header Codes-
Note: The cell data IS case sensitive. The headers ARE NOT case sensitive.
New File Name – This will use a custom file name to use when saving the final image. If the cell is empty then it defaults to the naming that was selected in the Sports Photo Automation Lab user interface.
Append File Name – This will add text to the end of the file name from the CSV data. If the cell is empty then it defaults to the naming that was selected in the Sports Photo Automation Lab user interface.
Team File – This is used for memory mate automation. It will auto replace the team image with the image name from the data cell. The team images must be in a sub folder of the source folder. The sub folder must be names “Teams”. See Memory Mate set up tutorial here.
Logo File – SPA will auto replace the logo image with the image name from the data cell. The logo images must be in a sub folder of the source folder. The sub folder must be names “Logos”.
Player 2 File – This will add a second image. The image can be another image of the player, a logo image, or any other image that you want to add on a per player basis. The image file must also be in the same source folder that the batch is being ran in.
Player 3 File – Works the same as Player 2 File.
BG File – This will use the background or PSD template in the cell. The background file must be in the same folder as the default background file you selected in the Sports Photo Automation user interface. If the cell is blank then it will use the default background selected in the user interface.
Save Folder – This will save in a subfolder of the save folder with the folder name from the cell data. You DON’T need to create the folders in advance. If the folder don’t exist then it will create them. Use this option is you want to separate the finished file by team, product layout, or anything else. If the cell is blank then it will just use the main save folder that you selected in the Sport Photo Automation user interface.
Scheme 1 (and 2,3 etc.) – Schemes are used for dynamic template setup. SPA supports up to 5 schemes in a single template. SPA will hide and show layers in the template based on the CSV data. It is commonly used for color schemes but can also be graphics schemes. Tutorial coming soon HERE.
Pre Action 1 (and 2,3 etc.) – Use this to run a Photoshop action on the file before it is extracted. You can run up to 10 actions. They run in sequential order. The column names will be Pre Action 1, Pre Action, 2, up to a max of 10. In the cell data put the name of the Action Set and the Action separated by the “|” character (the one on the \ key above the enter key).
Post Action 1 (and 2,3 etc.) – This is set up the exact same way as the pre actions except the header read as Post Action 1, Post Action 2, etc. The actions run after the template has been completed but before it is flattened and saved.