Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use PowerShell to create an SVG card, then render it to PNG with ImageMagick’s magick command. This keeps the design editable and makes the output repeatable. The example below creates a 1200 × 630 social-preview image; change its text, colors, and dimensions to suit your design and the platforms you target.

What you need before you start

This workflow uses PowerShell to prepare a design and manage files, while ImageMagick performs the image rendering and conversion. SVG is a useful intermediate format for cards built from text and shapes: it gives you a fixed canvas and editable design source without hand-authoring ImageMagick’s own drawing syntax.

  • PowerShell: to write the SVG file, create folders, and check the result.
  • ImageMagick: to render the SVG into a raster image such as PNG or JPEG. Install it from the official ImageMagick site and confirm that its magick command is available in your terminal.
  • A design specification: decide on a title, optional subtitle, background, brand colors, logo, and output format before making the card.

ImageMagick’s command-line documentation covers drawing primitives, text annotation, image processing, and output formats. Its vector-graphics documentation describes SVG as an option alongside MVG and programmatic interfaces; SVG is often easier to maintain when the design is primarily text and shapes.

Create an Open Graph image with PowerShell

Open PowerShell in the project directory where you want to work. The script below makes a working folder, writes a 1200 × 630 SVG, renders it to PNG, and throws an error if the output file is missing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
$work = Join-Path $PWD 'og-work'
New-Item -ItemType Directory -Force -Path $work | Out-Null
$svgPath = Join-Path $work 'card.svg'
$outPath = Join-Path $work 'card.png'

$title = 'Your title'
$subtitle = 'Your subtitle'
$titleEscaped = [System.Security.SecurityElement]::Escape($title)
$subtitleEscaped = [System.Security.SecurityElement]::Escape($subtitle)

@"
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="630" viewBox="0 0 1200 630">
  <rect width="1200" height="630" fill="#111827"/>
  <text x="72" y="220" fill="white" font-family="Arial, sans-serif" font-size="64">$titleEscaped</text>
  <text x="72" y="310" fill="#93c5fd" font-family="Arial, sans-serif" font-size="34">$subtitleEscaped</text>
</svg>
"@ | Set-Content -Encoding utf8 $svgPath

magick $svgPath $outPath
if (-not (Test-Path $outPath)) { throw "Image generation failed: $outPath" }

After it runs, og-work/card.svg is the editable source and og-work/card.png is the rendered image. The SVG viewBox and dimensions establish the canvas. The two text elements position the title and subtitle with baseline coordinates, while the rectangle supplies the background. Replace the text and color values with your design; change the canvas dimensions consistently in the SVG if your target platform calls for a different size.

Keep text safe for SVG

The script escapes the title and subtitle with [System.Security.SecurityElement]::Escape() before inserting them into XML. This matters when text contains characters such as & or <, which otherwise have special meaning in markup. If you add more dynamic text, escape each value in the same way. Text still needs a layout that fits the canvas: long titles may need a smaller font, manual line breaks, or additional SVG <text> elements.

Change the output format

For JPEG output, use a filename ending in .jpg or .jpeg in $outPath; ImageMagick selects common output formats from the extension. PNG is often convenient for graphics with sharp text and flat colors. If you are working with an input format or sequence that needs an explicit format specifier, ImageMagick documents prefix syntax; its formats documentation gives APNG as an example that can require an apng: prefix.

Add a logo or a downloaded background

If the card uses a remote background or logo, download the asset before rendering. PowerShell’s Invoke-WebRequest sends HTTP and HTTPS requests to a web page or service. Use -OutFile to save a file to a known path, then verify the download before using it in the SVG or an ImageMagick composition.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
$assetPath = Join-Path $work 'background.jpg'
Invoke-WebRequest -Uri 'https://example.com/background.jpg' -OutFile $assetPath
if (-not (Test-Path $assetPath)) { throw "Asset download failed: $assetPath" }

Replace the example address with the actual asset URL. A successful HTTP request does not by itself guarantee that the file is a usable image: check that the server returned the expected content and that ImageMagick can read the saved file. If the asset is private or the server requires authentication, provide credentials only through an appropriate secure mechanism; do not commit secrets to a script or repository.

For a logo or background, you can reference a local image from SVG using an embedded data URI, or compose the image and rendered text in ImageMagick. Keep the design source and asset paths stable in CI so the same input files produce the same intended card. Font availability also matters: if the rendering machine does not have the requested font, the text may appear differently from your local output.

Publish the image and connect it to your page

The generated file is not automatically the Open Graph image for a webpage. Publish it somewhere the page’s social crawlers can fetch over a stable public HTTPS URL, then set that URL in the page’s Open Graph metadata. For example:

<meta property="og:image" content="https://example.com/images/card.png">

Use the actual public URL where you deployed the image, not the local PowerShell path. Keep the URL stable when possible, and make sure access controls do not block crawlers. A file that exists on your computer but is not publicly reachable cannot be fetched by a social platform when it reads the page metadata.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Automate generation in GitHub Actions

If cards are derived from repository content, you can run the generation workflow in CI rather than relying on a developer’s local installation. The potatoqualitee/ogimage project documents an Open Graph image GitHub Action, including PowerShell-compatible use on Windows and Ubuntu, configurable file naming, and artifact output. Review its current setup and maintenance details before adopting it, and pin or otherwise manage action versions according to your repository’s policy.

Whether you use that action or your own workflow, make the inputs explicit: the title and other card content, the SVG or template, fonts and assets, and the output path. Confirm in the workflow that the rendered file is retained or deployed where intended. An artifact available in a CI run is not necessarily a publicly served image; deployment is a separate step if the page’s og:image URL must point to it.

Choose a generation path

Path Best fit Tradeoffs
PowerShell and ImageMagick locally Developers who want direct control over the card and a repeatable local script. Requires a local renderer installation and attention to fonts, assets, and environment differences.
GitHub Action Repository-driven cards that should be generated as part of a build. Depends on CI configuration and the action’s current behavior and maintenance.
Hosted OG-image API Teams that prefer to request generated cards through a managed service. Adds a service dependency; check its supported design inputs, data handling, and pricing terms. OGMagic documents a URL-driven hosted API as one example.

Common problems and fixes

magick is not recognized

ImageMagick may not be installed, or its command directory may not be on the terminal’s PATH. Install ImageMagick from its official source, open a new PowerShell session after installation, and confirm the command is available before running the script.

The command runs but no image appears

Check that the script’s working directory is the one you expect and that $outPath points to the desired location. Run the final Test-Path check and inspect any ImageMagick error output. Also confirm that card.svg was written and contains valid SVG markup.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The text is missing, clipped, or visually different

Make sure the text fits inside the canvas and that the chosen font is installed on the machine doing the render. Fonts are not guaranteed to match across a workstation and CI environment. Use a font available in both places or install and manage the intended font as part of the build environment.

Special characters break the card

Escape every dynamic text value before inserting it into SVG. The example escapes its title and subtitle; inserting unescaped XML-sensitive characters can make the SVG invalid or change how it is parsed.

A downloaded asset cannot be rendered

Verify that the request saved the expected image rather than an error page, login screen, or other response. Confirm the file path and format, and test whether ImageMagick can open that file. For a remote asset, a changed URL, access restriction, or network failure can interrupt the workflow.

The social preview does not update

Check the page’s actual og:image value and verify that it resolves publicly over HTTPS. Then check whether the image URL itself changed and whether the platform is showing a cached preview. The image-generation script cannot ensure that a social service has refreshed its stored page data.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If the image you need is a screenshot of a webpage rather than a custom-designed title card, ScreenshotNeo can return a screenshot through one API request. It is not a replacement for the SVG/ImageMagick design above when you need branded text and layout. The API can return PNG, JPEG, WebP, or PDF, and its feature set includes options such as full-page capture, CSS-selector element capture, viewport and device settings, and custom CSS and JavaScript. See the ScreenshotNeo API documentation for request options.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides screenshot tools for AI agents, including Claude, Cursor, and other MCP clients.

The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 screenshots; yearly billing gives two months free. See ScreenshotNeo for the service details, or sign up for the free plan.

Frequently Asked Questions

Can I create JPEG output instead of PNG?

Yes. Set the output filename to a JPEG extension such as .jpg or .jpeg so ImageMagick writes that format.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Does creating the file set the page’s social preview automatically?

No. Publish the image at a public HTTPS URL and set that URL in the page’s og:image metadata.

Can I use a screenshot as an Open Graph image?

Yes, when a webpage capture is the image you want. It does not provide the custom title-card design of the PowerShell and SVG workflow.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.