| ▲ | Show HN: Turn raw HTML into production-ready images for free(html2png.dev) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 points by alvinunreal 9 hours ago | 36 comments | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | me_bx 2 hours ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Congrats on launching, beautiful design. I'm not sure of what "production ready" is supposed to mean here, but the demo image is not optimized, `optipng` command decreases its size by 53.21%. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | Retr0id 6 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What differentiates production-ready images from regular images? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | oefrha 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I’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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | randoments 2 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What is the use case for requiring this? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | rognjen 2 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
It's nice looking for sure but much more complex than using `wkhtmltox` with `pngquant`, `optipng` and/or ImageMagick `convert` locally - esp. since the learning curve seems to be about equivalent. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | reassess_blind 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I 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. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | jihchi 5 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This is cool! One use case is generating a Mermaid diagram as an image. For example, you can use the following HTML[^1]:
Then html2png.dev will serve you:
[^1]: https://mermaid.js.org/config/usage.html#simple-full-example | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | geooff_ 7 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Very cool. Is there an option to self-host? This seems like it could be a cool agent skill. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | tbrownaw 6 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Playwright behind a web server? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | WilcoKruijer 3 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I’ve been doing this manually by having a static development-only route on my website and taking a “node screenshot” using the Chrome developer tools. This is definitely a better way, well done! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | agentifysh 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
that "Not MCP" is so refreshing it makes me laugh out loud it's literally waht i've been saying all along when I came across mcp "why can't i just give agent a prompt and it will run the rest api calls for me" there's still some MCPs which makes sense but we have it for literally everything when just a prompt will do the job! now on the topic of html2png i do wonder is this like the self-hostable version on github https://github.com/maranemil/HTML2Png where they use canvas? or is this something else ? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | jumploops 4 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Love the simplicity and “Not MCP” callout (: Not that it matters, but curious what percentage of this service was “vibe-coded”? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | eastoeast 9 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
This is a great idea. I can’t believe I didn’t think of this, given I generate and screenshot so many “poster images” in html just like this. Haven’t played around a ton but seems intuitive. Nice work! | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | RyanShook 7 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Nice! It definitely makes you wonder when is MCP actually needed vs just giving the LLM API calls to work with. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | chevman 7 hours ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Any similar AI based services/agents that can take images/creative assets (eg Figma, Sketch, Adobe PS, etc files) and create production-ready emails and landing pages in HTML? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | xiaohanyu 8 hours ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Maybe webp is a better target than png? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||