Maybe webp is a better target than png?
It's not. JPG, I could live with but please not webp.
Show HN: Turn raw HTML into production-ready images for free
11–20 of 87 posts
Re: Show HN: Turn raw HTML into production-ready images for free
#12Re: Show HN: Turn raw HTML into production-ready images for free
#13What differentiates production-ready images from regular images?
Re: Show HN: Turn raw HTML into production-ready images for free
#14I’m afraid out of all the waiting strategies available in Puppeteer/Playwright, waiting a fixed period is the worst possible. Maybe consider exposing the proper waiting strategies, load/domcontentloaded/networkidle, maybe even the more fine-grained ones https://playwright.dev/docs/actionability
Re: Show HN: Turn raw HTML into production-ready images for free
#15
graph LR
A --- B
B-->C[fa:fa-ban forbidden]
B-->D(fa:fa-spinner);
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
Then html2png.dev will serve you: https://html2png.dev/api/blob/oTVGhhCc6rDZYQFDIE3EGkcKs-KO6J9-_DHs-jO2OJc-d23fb4f2.png
[^1]: https://mermaid.js.org/config/usage.html#simple-full-exampleRe: Show HN: Turn raw HTML into production-ready images for free
#16Earlier quoted context omitted.
It's not. JPG, I could live with but please not webp.
Why? I assume the intention is to show these images on a webpage somewhere. WebP is well-supported by browsers and can store lossless images at better compression ratios than PNG, so why not use it? I don't think using a lossy format like JPEG makes much sense. JPEG is a fine format for photos, but for HTML content rendered as an image I assume most people would want a lossless format so you don't get artifacts.
Re: Show HN: Turn raw HTML into production-ready images for free
#17What differentiates production-ready images from regular images?
Generally I find production-ready images have more synergy and tend to be web-scale. Often they're built from the ground up for AI & are blazing fast, at scale, and empower your team whilst unlocking new possibilities. As my sibling comment suggests, being cloud-native is a crucial factor too.
Re: Show HN: Turn raw HTML into production-ready images for free
#18Re: Show HN: Turn raw HTML into production-ready images for free
#19This is cool! One use case is generating a Mermaid diagram as an image. For example, you can use the following HTML[^1]: graph LR A --- B B-->C[fa:fa-ban forbidden] B-->D(fa:fa-spinner); import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs'; Then html2png.dev will serve you: https://html2png.dev/api/blob/oTVGhhCc6rDZYQFDIE3EGkcKs-KO6J9-_DHs-jO2OJc-d23fb4f2.png [^1]: https://mermaid.js…
Re: Show HN: Turn raw HTML into production-ready images for free
#20I thought this was satire. Usually you want to go from image to HTML, not the other way around. I suppose it does have its uses, though.