This is a free microservice for generating dynamic OG images (also called Twitter Cards or OpenGraph images) on the Edge, with Deno Deploy. All images are first rendered as SVG vectors, then rasterized to PNG, and ultimately cached as immutable assets. Totally customizable, with built-in support for multiple font faces, thousands of icons, and millions of colors, the possibilities are virtually endless.
Read more and check out the source code at the GitHub Repository. Found a bug? Please create an issue so it can be fixed. And if you find this project to be useful, please give it a star on GitHub. Thanks!
migo.deno.dev/:title.(png|svg)
migo.deno.dev/:title/:subtitle.(png|svg)
migo.deno.dev/:params/:title/:subtitle.(png|svg)
// base props of the imagewidth = 1280, height = 640, viewBox = "0 0 1280 640", pxRatio = "1.5", // set to 1 for low-resbgColor = "white", borderRadius = 0, // rounded image corners// iconicon = "noto:t-rex", // set to false to disable iconiconUrl = "https://icns.ml/{icon}.svg", iconW = 240, iconH = 240, // +iconWiconX = 520, // ((width - iconW) / 2)iconY = 60, // (iconH / 4)iconColor = "black", // fill coloriconStroke = "none", // stroke coloriconStrokeWidth = 0, // stroke width// title (first line of text)titleX = 640, // (width / 2)titleY = 450, // (iconH + iconY + (titleFontSize * 2.5))titleFontSize = 64, titleFontFamily = "sans-serif", // "Inter"titleFontWeight = "bold", titleColor = "#112233", // text colortitleStroke = "none", // stroke colortitleStrokeWidth = 0, // stroke widthtitleTextAnchor = "middle", // text-anchor// subtitle (second line of text)subtitleX = 640, // (width / 2)subtitleY = 530, // (titleY + (subtitleFontSize * 2.5))subtitleFontSize = 32, subtitleFontFamily = "monospace", // "JetBrains Mono"subtitleFontWeight = "normal", subtitleColor = "#334455", // text colorsubtitleStroke = "none", // stroke colorsubtitleStrokeWidth = 0, // stroke widthsubtitleTextAnchor = "middle" // text-anchor