(svg, color, w, h)
| 66 | |
| 67 | // Tint an SVG and rasterize it to fit within w×h (transparent); return {buf,w,h}. |
| 68 | async function rasterize(svg, color, w, h) { |
| 69 | const buf = await sharp(Buffer.from(tintLogo(svg, color))) |
| 70 | .resize(w, h, { fit: "inside", background: TRANSPARENT }) |
| 71 | .png() |
| 72 | .toBuffer(); |
| 73 | const m = await sharp(buf).metadata(); |
| 74 | return { buf, w: m.width, h: m.height }; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * OG card: the brand lockup STACKED — the lotus mark above the "pollinations.ai" |