Hacker Newsnew | past | comments | ask | show | jobs | submit | jihchi's commentslogin

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.


Ah haha. I love this conversation of trying to find a product market fit in public.

What if the input to the JavaScript (mermaid in this case) is not trusted to run on the end client machines but by running untrusted input on a sandbox (this service, or self hosted idk) is somehow acceptable and the output a blob of an image is acceptable to display on the actual client machines.

Takes the planets to align just right and need us to squint just enough but I think we can find something if we look hard enough.

But then mermaid can simply output PNG so you could run it as a worker... Thinking...


It looks similar to https://hurl.dev


Hurl is well designed for testing with marchers available for assertions. HTTL only supports strict equality assertions (for now).

Hurl is written in Rust, HTTL in node.

HTTL has an import system that can be useful for reusing an auth setup.


It was funny that when I was in the middle of the project, I discovered Hurl. It was cool, especially since it's written in Rust and uses libcurl under the hood. However, the lack of OpenAPI support and VS Code integration forced me to continue working on HTTL project.


Hi maintainers of Hurl here! We started very small also and HN helps us a lot to grow and gain popularity. Keep up the good work and the motivation!

The only advice I'll humbly give is to choose a "traditional" license, unless there is a very strong motivation to have a custom one.


Oh yeah, that’s awesome! Thank you. You guys created a really great tool, it’s so motivating!



I'd love to join the group buy if it is possible


The author didn't respond on here... assuming he saw this I guess he wasn't interested.


Were you comparing two identical image? Could you try two different image?


To really see how these algorithms perform, you should compare the worst case for the algorithm. In order to see if a picture is identical, you’d have to loop through every single pixel, which is the worst case. But you can shortcut on the first pixel which is different, which I imagine happens pretty quickly on many generic pictures. So testing performance with two different images is probably not best for comparison.


You can only short-circuit if you’re returning a Boolean. If you need to do what these tools and return some metric for the degree of difference you still have to process both images in entirety.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: