export * from "@rakazo/core/plot"; /** Rasterize a rendered plot SVG to an opaque PNG. The SVG's CSS background is not honored by all rasterizers, and a transparent chart is unreadable on dark chat themes, so the alpha channel is flattened onto white. */ export async function plotSvgToPng(svg: string): Promise { const { default: sharp } = await import("sharp"); return sharp(Buffer.from(svg), { density: 144 }) .flatten({ background: "#ffffff" }) .png() .toBuffer(); }