explaingit

maxstridde/social_preview

Analysis updated 2026-05-18

1ShellAudience · developerComplexity · 1/5LicenseSetup · easy

TLDR

A pair of shell scripts that turn any photo into a 1200x630 social preview image for Open Graph and Twitter cards, using ImageMagick with simple or advanced design styles.

Mindmap

mindmap
  root((social_preview))
    What it does
      Photo to social image
      OG standard size
      Simple and advanced styles
    Requirements
      ImageMagick 7
      Font file
      Bash shell
    Batch and automation
      Batch over folder
      CI pipeline friendly
      LLM palette prompt
    Output usage
      Open Graph meta tags
      Twitter card
      LinkedIn and chats
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Generate a social preview image for every blog post by running og-batch.sh over a folder of hero images in a CI pipeline.

USE CASE 2

Create a branded Open Graph card for a personal website by customizing the accent colors and font in og-advanced.sh.

USE CASE 3

Automate per-post social previews by having an AI rewrite the title and color variables from each post's frontmatter before running the script.

What is it built with?

ShellImageMagick

How does it compare?

maxstridde/social_previewfoxtrotdev/codex-butler-bellverona136/common-official-document-format-skill
Stars111
LanguageShellShellShell
Setup difficultyeasymoderateeasy
Complexity1/52/52/5
Audiencedeveloperdeveloperwriter

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Requires ImageMagick 7 installed and a .ttf font file path configured at the top of the script.

Use freely for any purpose including commercial projects, no warranty.

In plain English

This is a pair of shell scripts that convert any photo into a social preview image, the rectangle that appears when you share a link on social media or in chat apps. The target size is 1200 by 630 pixels, which is the standard for Open Graph images used by platforms like Twitter/X, LinkedIn, and Facebook. The only dependency is ImageMagick, a widely available image processing tool. The simpler script places the photo as the background, adds a dark gradient across the bottom half so text stays readable on any photo, and overlays two centered lines of text. The advanced script creates a more designed layout: the photo sits inside a framed box with rounded corners and a soft shadow, three colored accent shapes peek out from behind the frame, and a title block with a button sits next to the photo. The advanced layout automatically adjusts to whether the input photo is portrait or landscape. Both scripts are configured by editing a short block of plain variables at the top of the file. You change things like the title text, font file path, and accent colors there. The README includes a PROMPT.md file you can paste into an AI assistant to get a suggested color palette that matches your site. A batch script runs either style over an entire folder of images, which makes it easy to add to a build pipeline or CI workflow. Because the configuration is just simple key-value lines, an AI can modify the title and colors per post from a Markdown frontmatter block before calling the script, enabling a fully automated per-post preview pipeline. Once generated, you reference the image in your page's HTML head section using standard Open Graph and Twitter card meta tags. The license is MIT.

Copy-paste prompts

Prompt 1
How do I use og-simple.sh to generate a 1200x630 social preview from a landscape photo with my blog name and a subtitle line?
Prompt 2
I want to run og-batch.sh in a GitHub Action to regenerate social previews whenever new images land in my content folder. What does the workflow step look like?
Prompt 3
How do I use the PROMPT.md file from the social_preview repo with Claude to get S1/S2/S3 accent color values that match my site's palette?
Prompt 4
How do I adapt og-advanced.sh to generate per-post social previews with a title and date pulled from each post's Markdown frontmatter?

Frequently asked questions

What is social_preview?

A pair of shell scripts that turn any photo into a 1200x630 social preview image for Open Graph and Twitter cards, using ImageMagick with simple or advanced design styles.

What language is social_preview written in?

Mainly Shell. The stack also includes Shell, ImageMagick.

What license does social_preview use?

Use freely for any purpose including commercial projects, no warranty.

How hard is social_preview to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is social_preview for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub maxstridde on gitmyhub

Verify against the repo before relying on details.