Parsing CSV Files with Retrobatch Pro
With Retrobatch Pro 2.2, you can efficiently parse CSV (Comma Separated Values) files to generate customized images based on a template.
Whether you're creating a set of invitations or overlaying a series of images on a base, this guide will walk you through the process.
Creating an Invitation
Consider a scenario where you are organizing a party and want to send out personalized invitations. You have a guest list and an invitation template, and the goal is to create a unique invitation for each person on the list.
Download our sample project
To begin, create a new workflow and save it as invitation_template.retrobatch
. Next, drag and drop the template/background image (invitation_template.png
) onto the canvas:
At this point, there is a single image with basic event details but no personalization yet.
Next, drag and drop your CSV file onto the canvas. This will automatically create a "CSV Reader" node. Then, add a "Text Watermark" node after it. Your canvas should now resemble the following:
Understanding the CSV File
Upon opening the CSV file in a text editor, you'll find that it is fairly straightforward:
FullName,Address,WhimsyImage,OutputFileName
August Mueller,"123 Street, Mukilteo WA",whimsy_images/hare.png,augie
Stevie Ray Vaughan,"567 Road, Austin TX",whimsy_images/bird.png,stevie
Jimi Hendrix,"6 was 9 Ct., Seattle WA",whimsy_images/lizard.png,jimi
The first row contains the column headers, and the subsequent rows are the entries. Here's the breakdown:
FullName
: The guest's full name.Address
: Their address.WhimsyImage
: A unique image for each individual.OutputFileName
: The name for the output image file.
Customizing the Invitation
Now, return to the workflow. Open the properties for the Text Watermark node and select the dropdown menu. You will see entries from the CSV file. Select "CSV:FullName," and a new text token will be added to the text box. Adjust the font and size as needed (e.g., Zapfino at 48px), center the image, and set a Y offset of 400 pixels for the text placement.
By clicking the Text Watermark node, you will get a preview of your personalized invitation:
Next, add the address in a smaller font. Insert another Text Watermark node and set the font size to 36px. For the token field, choose "CSV:Address." The node properties should look similar to this:
At this stage, the invitation should be coming together:
Adding a Unique Image (Whimsy Image)
Now, incorporate the "WhimsyImage" from the CSV file. This field points to an image within the whimsy_images/
folder. To add these images to the template, use the "Dynamic Image Overlay" node (found in the Watermark category, see also RBTN005). Open the properties inspector for the node:
In the Dynamic Image Overlay node, type $CSV.WhimsyImage$
to specify the source for the images.
Center the image, adjust the scale, and reduce opacity to 70% for a subtle overlay. Set the Y offset to 150 pixels to position the image properly within the template.
Saving the Customized Invitations
Lastly, you need to save the output images. Add a "Write Images" node, specify the output folder, and set the file name to "CSV:OutputFileName". This ensures the images are named according to the OutputFileName
field from the CSV file. Set the file type to PNG.
When you run the workflow, the result will be three images: augie.png, jimi.png, and stevie.png, each featuring personalized names, addresses, and whimsy images: