Settings

Theme

Show HN: qrframe – generate beautiful qr codes with javascript code

github.com

401 points by zhengkyl 2 years ago · 80 comments · 1 min read

Reader

I originally built a QR code generator as a resume project using Rust and I realized a web interface would make customization way easier.

This still generates the "data" using that rust library via wasm, but the rendering is all editable javascript to make an SVG or paint on an HTML canvas.

I was especially inspired by https://qrbtf.com which had some unique style options I had never seen before, which I ended up copying, and then I made some more.

bscphil 2 years ago

This looks super cool but I could only get 10/21 to scan with the classic zxing scanner (>100M downloads), and 3 of those took a bunch of playing with camera angles and distance, so I'd recommend against using anything too fancy for real world barcodes.

  • zhengkylOP 2 years ago

    Thanks for trying it out! I definitely agree, the fancier it gets the harder it is to scan so these should not be used for real world stuff where reliability is important.

    I basically only tested these on my own phone, a pixel 7 with default camera app, so I'm not surprised people with different hardware/software are getting varied results. I think I might try to automate testing using different scanners if I can figure that out.

  • sandos 2 years ago

    Hmm, yes, I did not try these but I have noticed that my default phone app in my S22 is freakishly fast at detecting QR codes, something I never remember that zxing was.

    Does anyone know if these are today implemented in neural networks or something? Specialized hardware? Or just very well optimized. Sometimes it feels like only 1 frame in the camera is enough, and distance, angle, lighting and focus is not important.

    • yonatan8070 2 years ago

      I'm pretty sure the decoding is done on each frame individually, so as long as you get a single good frame, you scan it

KolmogorovComp 2 years ago

Neat! In my opinion those generated by generative AI with controlnet are even more impressive [0], albeit also reducing their likelihood of being correctly read by all.

[0] https://stable-diffusion-art.com/qr-code/

  • Jleagle 2 years ago

    While I do agree, one can be done almost instantly in your browser, one takes hours of rendering.

    • Miraste 2 years ago

      Even on a slower machine, it'll be minutes, not hours. A fast one with an optimized process can be seconds.

    • Uehreka 2 years ago

      Libs like qrframe are great for automating QR code creation in a web app, the ControlNet stuff is great for if you just need to make one QR code for an event or want an animated QR code (stuff like this is usually several frames per minute if you’ve got a good GPU).

  • hipjiveguy 2 years ago

    People have to be able to recognize that it is a QR code visually - these are too graphical to realize their true purpose, imho

  • mock-possum 2 years ago

    Wow somebody likes anime girls

suriya-ganesh 2 years ago

The author also has a rust based qr library that looks equally awesome

https://github.com/zhengkyl/fuqr

thih9 2 years ago

Looks great, very inspiring.

Some of these, like examples/blocks.svg[1], are not immediately recognized as qr codes by humans. This could lead to interesting possibilities; e.g. art with qr code/codes seamlessly integrated into it - and perhaps noticed only after someone tries to take a picture.

[1]: https://github.com/zhengkyl/qrframe/blob/b7705844b71764bcea8...

OhMeadhbh 2 years ago

hmm. i can't scan most of these QR codes (i got about 2 of them to scan.) so while i applaud the creative impulse (some of them look REALLY cool), i recommend people use QR codes that are easily scanned.

leesalminen 2 years ago

Wow, super cool! I love the unique styling. Haven’t seen that before.

I (well, GPT-4) built freeqrgenerator.app specifically for my wife because she kept using the malicious sites that inject a redirect that inevitably die and stop working.

Thinking I can retire mine and use yours instead on the domain.

zhengkylOP 2 years ago

Did anyone else just watch the Veritasium video

dylan604 2 years ago

These are probably some of the more interesting looks I've seen. My poor phone looked like it was having a conniption fit trying to lock onto just one.

kristopolous 2 years ago

I should look more into the half-tone. I'm assuming it works off of the error tolerance margins but I actually have no idea.

chfritz 2 years ago

> These QR codes are not reliably scannable!

Isn't the whole point of QR codes to reliably transfer information from the physical world into the digital one without specialized equipment or software? They look pretty, sure, but so did DataGlyphs (https://www.microglyphs.com/english/html/dataglyphs.shtml) and those could be scanned reliably, just not by your average phone.

cipherzero 2 years ago

This is awesome. Does anyone know if there is a library for the amazing optical codes that apple uses in its device transfer? I know they have a custom patent for it so I don't know if its something anyone has tried to recreated...

vishnugupta 2 years ago

The designs are cool enough that they could be printed on physical wall tiles, maybe as easter eggs or otherwise.

  • keepamovin 2 years ago

    They should be! These would go well in all kinds of interior places, and would not be out of place on expensive high-end art / photography books and periodicals.

kypro 2 years ago

I didn't expect these to look so awesome. Great work on the designs.

spankalee 2 years ago

I tried to use the qrframe package, but it doesn't seem to be published to npm https://www.npmjs.com/package/qrframe

kdjdjdndnd 2 years ago

While those look cool, most do not work at all on my phone

fitsumbelay 2 years ago

thanks for this. awesome post

sirolimus 2 years ago

This is cool

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection