This repository holds picasso templates that can be used to generate image assets. Picasso is a tool that can take a template and data, and generate images from them. The templates that Picasso uses are written in HCL (HashiCorp Configuration Language) and define the input, output and design of the resulting image.
Some of these templates might require additional assets to be copied into this repository for them to work. Due to licenses for those assets, they are not included in this repository.
Note: The paths in the templates are computed from the folder the binary is run in. This means that a template that refers to
images/background.pngand is executed with the commandpicasso generate -t hashitalks/regional/banner.hclwill look for the background at$PWD/images/background.png.
-
Download the binary for your operating system located at Picasso's releases.
-
Unzip the binary using your command line.
unzip picasso_${OS}${ARCH}.zip -
Make sure to change the permissions it is executable.
chmod +x picasso
-
Copy the
picassobinary to your/usr/local/bin.$ cp picasso /usr/local/bin
-
You can verify that you've installed it by running
picassoin your command line.picasso
Let's say you want to generate assets for HashiTalks: Test. You need the following
images:
- A banner for Marketo (for sending emails)
- Social graphics (Twitter and LinkedIn share cards)
We have some templates created for you. You can use these to generate a banner and social graphics for your regional HashiTalks.
-
Reach out to the HashiCorp Community team to retrieve the background and font assets. They will send you a compressed file named
picasso_assets.zip. -
Download this repository.
git clone https://github.com/eveld/picasso-templates.git
-
Change folder into the repository.
cd picasso-templates -
Unzip the
picasso_assets.zip. -
Copy the
images/andfonts/folders to this repository. -
Generate a banner using
picasso. You need to pass some information. Use the template inhashitalks/regional/banner.hcland output the image tobanner.png. You also need to specify the regional edition of HashiTalks by setting theeditionvariable. In our example, we setedition="Test".picasso generate \ -t hashitalks/regional/banner.hcl \ -o banner.png \ --var edition="Test" -
You should now have a file named
banner.pngwithHashiTalks: Test.
-
You can generate a social media card with a similar command. Use the
card.hcltemplate, output the image tocard.png, and add a tagline.picasso generate \ -t hashitalks/regional/card.hcl \ -o card.png \ --var edition="Test" \ --var tagline="Regional learning" -
You should now have a file named
card.pngwithHashiTalks: Testand the tagline,Regional learning.
After you've scheduled speakers for HashiTalks, you can create speaker cards. These can be used for speakers to promote their talks over social media and for transition slides.
-
Make sure you have a folder named
Hashitalkswith folders called:fonts/images/picasso-templates/
-
In the
HashiTalksfolder, make a new folder calledspeakers. -
Download all of the speaker photos into the
speakersfolder. -
Crop all photos to be 400 x 397 pixels. This ensures that the top and bottom of the photo line up with the top and bottom of the text.
-
Create a comma-separate value file with the edition, speaker, title, photo, date, and URL.
- Headings must be lower case.
- Make sure the photo uses the correct file name of the photo in the
speakersfolder. - For example, your CSV file might look like below:
edition,speaker,title,photo,date,url Test,Cookie Monster,DevOps is like a Cookie,speakers/cookie.jpg,January 1st 2021,hashi.co/hashitalks
-
Save and download the file as
hashitalks.csvin theHashiTalksfolder. TheHashiTalksfolder should now contain the following:hashitalks.csv- CSV file with speaker names, titles, and photosspeakers/- folder with all of the original speaker photos, cropped to 400x397fonts/- folder with special fontsimages/- folder with background images and logospicasso-templates/- folder with all of the templates.
-
Open a terminal and navigate to the
HashiTalksfolder. -
Run
picassoto generate the speaker cards. It uses the template for a speaker card with 1 line and outputs all cards to theHashiTalksfolder.$ picasso generate \ -t hashitalks/regional/speaker_1line.hcl \ --csv hashitalks.csv \ -o . -
You should now have many files named
output-<some id>.pngfor the speaker. For multiple speakers, each file will have a unique ID.