• me_bx
  • ·
  • 2 hours ago
  • ·
  • [ - ]
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%.

Thank you. Can add png compression too right.
also don't ignore webp and avif ... those can really do wonders.
What differentiates production-ready images from regular images?
They're bedazzled by a little bit of marketing flair.

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.

If I need more flair can I embed the image in a new html page and then create another image from that?
Downvoted for not starting with "Great question!" /s
They are cloud-native, of course.
Do they support also DeFi or Blockchain then?
Is this post a joke?
It's not an image—it's an image on the edge.

No cruft. No legacy formats.

Just buttery smooth production readiness.

> buttery smooth

But buttery bloated if the images don't run OptiPNG before exporting.

Thanks ChatGPT
[flagged]
What is the use case for requiring this?
Dynamic og:image generator could be a use case.

Think of the GitHub thumbnails where the PR number changes constantly and has to be reflected on the image preview

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
I did some tests and it didn't seem like a fixed wait, when I kept making network requests the render timed out entirely.
I made the comment based on the delay parameter (“Wait time in ms.”) in the API. I didn’t test so don’t know what the default behavior is.
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.
  • krick
  • ·
  • 1 hour ago
  • ·
  • [ - ]
Yeah, I thought that as well. So I was wondering if that's some kind of a joke, or maybe modern html is so fucked up that all usual solutions became obsolete since the last time I did that.
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.
It certainly does, that's why it's been a common dev tool for a bit over 20 years. I'm not really sure what the point of OP making it a web app is, though.
This is cool! One use case is generating a Mermaid diagram as an image. For example, you can use the following HTML[^1]:

  <!doctype html>
  <html lang="en">
    <body>
      <pre class="mermaid">
    graph LR
        A --- B
        B-->C[fa:fa-ban forbidden]
        B-->D(fa:fa-spinner);
      </pre>
      <script type="module">
        import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
      </script>
    </body>
  </html>
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-example
Why wouldn’t you just use Mermaid to generate the PNG directly?
One reason I could think of: Fewer dependencies that need integration
By introducing a dependency on a third-party service with no SLA? This seems to make the dependency situation worse.
Very cool. Is there an option to self-host? This seems like it could be a cool agent skill.
HTML to PNG:

    chromium --headless --disable-gpu --screenshot=output.png --window-size=1920,1080 --hide-scrollbars index.html
Also works great for HTML to PDF:

    chromium --headless --disable-gpu --no-pdf-header-footer --run-all-compositor-stages-before-draw --print-to-pdf=output.pdf index.html
Playwright behind a web server?
  • franze
  • ·
  • 5 minutes ago
  • ·
  • [ - ]
i created an image that self reported the setup, this was the outcome:

Here is the structured analysis converted into a clean Markdown bulleted list.

# html2png.dev Infrastructure Analysis

* *Network & Location* * *Provider:* Cloudflare (AS13335) * *IP Address:* `104.28.157.29` * *Location:* Narita, Chiba, Japan * *Infrastructure Type:* Cloudflare Edge Network

* *Browser Environment* * *Browser:* Chrome 126.0.0.0 (Headless) * *Engine:* Blink / WebKit * *Platform:* Linux x86_64 * *Automation Framework:* Puppeteer or Playwright (indicated by `navigator.webdriver: true`) * *User Agent:* Standard Linux Chrome 126 UA string

* *Graphics & Rendering* * *Renderer:* ANGLE (Google, Vulkan 1.3.0 SwiftShader Device) * *GPU Type:* SwiftShader (Software Rendering) * Note: Uses CPU for graphics processing instead of a dedicated GPU. * *Vendor:* Google Inc. * *Color Depth:* 16 bit

* *Server Hardware Specs* * *CPU:* 4 Cores * *Memory:* Containerized (hidden) * *Display:* * Virtual Screen: 1024x768 @ 2x DPR * Outer Window: 500x88 (typical headless indicator)

* *Automation Detection Signals* * *WebDriver Flag:* `true` (Confirmed automation) * *Chrome Object:* Present (`window.chrome` is an object) * *Runtime/App:* `chrome.runtime` is undefined; `chrome.app` is present. * *Plugins:* 5 detected

* *Full Tech Stack* * *CDN/Proxy:* Cloudflare * *Frontend:* Nuxt.js 3 (Vue.js) * *Backend:* Node.js API * *Hosting Hypothesis:* Likely Cloudflare Workers + Durable Objects OR Vercel/Railway behind Cloudflare. * *Storage:* Ephemeral blob storage.

* *Operational Workflow* 1. *Request:* Hits Cloudflare Edge (Japan). 2. *API Processing:* Node.js server accepts HTML and parameters. 3. *Launch:* Puppeteer initializes Headless Chrome. 4. *Render:* SwiftShader captures WebGL/CSS (CPU-based). 5. *Storage:* Image saved to temporary blob storage. 6. *Response:* JSON returned with the public URL.

* *Key Insights* * *Cost Efficiency:* Utilization of SwiftShader eliminates the need for expensive GPU instances. * *Performance:* High-speed global delivery ensured by Cloudflare fronting. * *Accessibility:* No authentication required (Open API); ephemeral storage suggests a focus on privacy/low storage costs. * *Version:* Uses a recent, stable version of Chrome (126) rather than bleeding-edge.

* *API Configuration* * *Method:* `POST` * *URL:* `https://html2png.dev/api/convert?width=1200&height=630&forma...` * *Content-Type:* `text/html`

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!
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 ?

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!
Nice! It definitely makes you wonder when is MCP actually needed vs just giving the LLM API calls to work with.
Love the simplicity and “Not MCP” callout (:

Not that it matters, but curious what percentage of this service was “vibe-coded”?

Maybe webp is a better target than png?
No, because their domain is png /s

I thought webp would be better for this and checked again just to be sure, and yes, it would be better for this. WebP is quite well supported, albeit not as well supported as png, and it can have significantly smaller file sizes for the same lossless image as png.

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.
Definitely should be WebP.
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?