{"id":53,"date":"2026-07-08T10:42:31","date_gmt":"2026-07-08T10:42:31","guid":{"rendered":"https:\/\/blog.skndan.com\/jsontoimg\/?page_id=53"},"modified":"2026-11-17T13:33:59","modified_gmt":"2026-11-17T13:33:59","slug":"report-thumbnails","status":"publish","type":"page","link":"https:\/\/blog.skndan.com\/jsontoimg\/use-cases\/report-thumbnails\/","title":{"rendered":"Report Thumbnail Generator: Dashboard Images from KPIs"},"content":{"rendered":"<p>Report lists look empty without a thumbnail, and a report thumbnail generator fills the gap. jsontoimg is the last mile: you already computed MRR, error rate, or \u201cweek of Sep 7.\u201d Push those strings (and an optional chart PNG URL) into a template and get a share-card for Slack and email.<\/p>\n<h2>Do not make the renderer query your DB<\/h2>\n<p>The API will not join warehouses. A cron in your app formats the snapshot, POSTs batches of 50, and writes assetUrl back. If a KPI is missing, fail the job in your code before you call jsontoimg \u2014 a blank layer is worse than a skipped thumbnail.<\/p>\n<h2>Format the numbers before you send them<\/h2>\n<p>The renderer draws strings. It will not round your MRR, pick a currency symbol, or decide whether 0.0847 is a rate or a percentage. Do that in the cron, with <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/JavaScript\/Reference\/Global_Objects\/Intl\/NumberFormat\">Intl.NumberFormat<\/a> or your language&#39;s equivalent, and send the finished text.<\/p>\n<p>Then decide what a missing value means. A null KPI should fail the job in your code, not render a blank layer in a card that goes to a customer. A zero is a real number and should render as &quot;0&quot;, not as nothing. And watch the width: &quot;$1,284,902&quot; is a lot wider than &quot;$12,849&quot;, so size the box for the biggest number the account could plausibly hit and auto-fit below that.<\/p>\n<h2>Slack unfurls and nightly runs<\/h2>\n<p>A thumbnail is only useful where it gets seen. Slack needs a publicly reachable URL to <a href=\"https:\/\/api.slack.com\/reference\/messaging\/link-unfurling\">unfurl a link<\/a> into a preview, so store the asset and post the URL rather than attaching bytes. Serve it with a long <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Reference\/Headers\/Cache-Control\">Cache-Control<\/a> lifetime \u2014 last week&#39;s snapshot is immutable by definition.<\/p>\n<p>Scale is a loop, not a bigger request: 50 tenants per batch, keyed by tenant id, re-rendering only when the snapshot date changes. The <a href=\"https:\/\/jsontoimg.com\/blog\/batch-image-generation-generate-thousands-of-images\">batch guide<\/a> covers pacing and retries for the nightly job.<\/p>\n<h2>Related<\/h2>\n<ul>\n<li><a href=\"https:\/\/jsontoimg.com\/use-cases\">All image generation use cases<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/docs\/guides\/webhooks\">Webhooks docs<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/use-cases\/social-posts\">Social media image generation API<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/use-cases\/open-graph-images\">OG images<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/use-cases\/email-hero-images\">Email heroes<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/batch-image-generation-generate-thousands-of-images\">Batch image generation<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/json-to-image-converter\">How JSON-to-image conversion works<\/a><\/li>\n<li><a href=\"https:\/\/jsontoimg.com\/blog\/image-automation-api-workflows\">Image automation API guide<\/a><\/li>\n<\/ul>\n<h2>FAQ<\/h2>\n<h3>Where do the KPI numbers come from?<\/h3>\n<p>Your warehouse or dashboard API. jsontoimg does not query Stripe or Postgres. Format the numbers, then send them as layer text (and optional chart image URL if you pre-render a sparkline).<\/p>\n<h3>Nightly for every tenant?<\/h3>\n<p>Batch 50 tenants per request, loop the rest. Store assetUrl next to the report row. Re-render only when the snapshot date changes.<\/p>\n<h3>Is this a BI tool?<\/h3>\n<p>No. It is a thumbnail factory for a report that already exists.<\/p>\n<p><a href=\"https:\/\/app.jsontoimg.com\/login\">Get 25 free images \u2192<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nightly KPI snapshot: push numbers into a template, get a PNG for Slack, email, and the reports list.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":45,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-53","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/pages\/53","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/comments?post=53"}],"version-history":[{"count":5,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/pages\/53\/revisions"}],"predecessor-version":[{"id":407,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/pages\/53\/revisions\/407"}],"up":[{"embeddable":true,"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/pages\/45"}],"wp:attachment":[{"href":"https:\/\/blog.skndan.com\/jsontoimg\/wp-json\/wp\/v2\/media?parent=53"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}