Design & media

resize-for-banner

Try it

Resize an image into a Twitter/X header banner (5:2, 1500x600) using ImageMagick. The image is rescaled to fit and the leftover space is padded black — never cropped, so no content is lost. Use when the user wants a Twitter/X banner for an article or infographic. Twitter/X is the only target: LinkedIn and blog headers accept the original image, so never generate a derivative for them. Never overwrites the original — writes a new file beside it.

What it does

Turn one image into social banner variants with ImageMagick, keeping the original file untouched and writing new files beside it. The image is **rescaled to fit and black-padded**, never cropped, so no content is lost.

The skill document

Resize for Banner

Turn one image into social banner variants with ImageMagick, keeping the original file untouched and writing new files beside it. The image is rescaled to fit and black-padded, never cropped, so no content is lost.

Platform specs

PlatformRatioDimensionsNotes
Twitter / X5:21500x600Header photo. Default.
LinkedIn article16:91200x675Article header. Usually unnecessary — generated infographics are already 16:9.
YouTube channel16:92560x1440Channel art; safe area is 1546x423 center.
Blog / genericanyany WxHCustom dimensions on request.

If the user does not specify a platform, default to Twitter (1500x600).

Approval gate

  • Never touch the original image. All output goes to new files named after the original (suffix added, base name unchanged).
  • Confirm the plan with the user before converting: the source image, the target size(s), and the exact output filenames.
  • If the user asks for a size the spec does not cover, use that size with the same resize + pad technique and say which platform it suits.

Inputs

  • source — Path to the original image, e.g. ai-thoughts/imgs/260806-1656.png. Required.
  • sizes — Which banners to produce. Default: Twitter 1500x600. User may request any platform from the specs table or custom dimensions.

Outputs

  • imgs/-banner-.png — e.g. 260806-1656-banner-twitter.png.
  • `` keeps the original filename exactly. The original file is never modified.

Procedure

  1. Confirm the plan with the user: source image, target size(s), output filename(s). Get a go-ahead before writing files.

  2. Check the original dimensions with magick identify "" so you can predict which axis will be padded.

  3. Resize to fit, then pad with black with ImageMagick 7 magick:

    magick  -resize "x" -background black -gravity center \
      -extent x imgs/-banner-.png
    
    • -resize "WxH" (no bang) scales to fit inside the box, preserving the aspect ratio — the image is never distorted or cropped.
    • -extent WxH then pads the leftover space; -background black makes the padding dark and -gravity center centers the image.
    • If the source is taller/narrower than the target ratio, padding appears on the left and right; if it is wider, padding appears on top and bottom.
    • Padding color is black by default; ask the user if they want a different background.
  4. Verify every output with identify — dimensions must match the target size exactly.

  5. Report the output paths and confirm the original is untouched (git status shows the new files as untracked, the original unmodified).

Quality rules

  • Never overwrite or rename the source image.
  • Never crop the image. Resize to fit and pad — cropping loses content.
  • Do not invent dimensions. Use the platform specs table or the user's explicit dimensions.

Verification

  • identify reports exactly the target dimensions for each output.
  • The source image inside the banner is undistorted (aspect ratio preserved).
  • The original file is byte-identical (unchanged identify output / git status).
  • Output files sit beside the original in the same directory.

Error Handling

  • Source not found: list candidate images in imgs/ and ask which to use.
  • Output already exists: stop and ask whether to overwrite, or choose a different suffix.
  • No ImageMagick: magick is always installed on the user's machines — skip checking for it and run the commands directly.

Related skills

Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.

by nssa.io1.0k installs47 stars

Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.

by Iván559 installs18 stars

Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.

by johnpatternai22 installs8 stars

Fetch raw ad creative, app, ranking, and revenue data from AdMapix as structured JSON.

by fly0pants4.3k installs296 stars

Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.

by Iván855 installs69 stars

More from j3ffyang

Browse all skills

Polish a technical blog draft into an 800–1000 word, 3–4 section zh-CN article, preserve technical terms/code, and generate consistent hero + per-section image prompts when the user asks to polish and translate a blog with images.

by j3ffyang28 installs

Generate video from supplied image using Veo-3.0 async API. Gemini vision analyzes image, Veo creates video via predictLongRunning. All outputs in ~/.openclaw/workspace/tibetanProc/ with yymmddHHMM prefix.

by j3ffyang17 installs

Read a plain Markdown file (e.g. 260321_openclawConfig.md), generate header and section images using the default OpenClaw image model and API key from ~/openclaw/.env, create a new *_img.md copy with embedded PNGs, and move all generated images into an img/ folder next to the original file.

by j3ffyang13 installs

Polish a technical blog draft into a 1000–1200 word, 4–5 section en-US article, preserve technical terms/code, and generate one consistent hero image prompt.

by j3ffyang17 installs

Help the user draft, review, and polish blog posts in Markdown, keeping the original languages and informal tone.

by j3ffyang25 installs

Generate a daily AI news newsletter from fresh web sources. Use when the user asks for a current AI digest, AI news roundup, curated newsletter, or daily AI...

by j3ffyang16 installs