share-cards: social images from one HTML file

Every social site wants a different image size. share-cards turns one HTML design into all of them, with each platform's cropping in mind. It's free on GitHub.

A dark desk with a computer monitor showing mountains, a keyboard and a small lamp

Setting up our social profiles meant making a lot of images. A link preview is 1200 by 630 pixels. An X header is 1500 by 500, with your profile picture covering one corner. YouTube channel art is 2560 by 1440, but phones only show a thin strip across the middle.

We didn’t want to redraw the same design ten times, so we built a tool that does it for us. Today it’s our next open source release.

share-cards

share-cards takes one design, written as an ordinary web page, and saves it as an image at every size you need. It knows each platform’s safe area, the part that’s never cropped, so titles and logos stay in view.

Nine sizes come built in: link previews, X and LinkedIn headers, YouTube channel art, Instagram posts and stories, and profile pictures. Anything else is a width and a height away.

The design is yours. Any font, colour or graphic a web page can show will turn up in the image. Render one card from the command line, or list a whole batch in one file and make them all at once.

We built it from the scripts that make the images for every post on this site and on our social profiles. It runs on Mac, Windows and Linux with Node and Chrome, and it’s free under the Apache 2.0 license.

View share-cards on GitHub · Project page

More this month

This is the second of six open source releases leading up to Halloween. Find the rest on GitHub, or sign up for updates.

More from Firedance

Hear when FirePod goes on saleGet the early-bird price

FirePod isn't on sale yet. Leave your email and we'll write when it is.

FirePod isn't on sale yet. Sign up and the early-bird price comes to your inbox when it is.