August 31st, 2024

Client-side QR code generator with SVG output

QRSVG is a JavaScript project that renders customizable QR codes into SVG format, allowing users to modify shapes and colors, and download them in SVG or PNG, all client-side.

Read original articleLink Icon
InterestAppreciationFrustration
Client-side QR code generator with SVG output

QRSVG is a JavaScript project designed to render two-dimensional bitmasks, primarily QR codes, into SVG elements using SVG paths. The project aims to provide extensive customization options for QR codes, which are commonly used to convey digital information through physical media. While many existing QR code generators offer limited customization and often include ads or data tracking, QRSVG combines Project Nayuki’s QR Code generator library with its own capabilities to create a customizable SVG file from QR code data. The project allows users to modify shapes and colors of QR codes and offers downloadable options in both SVG and PNG formats. It operates entirely on the client side, meaning it can be hosted as static files without incurring costs. The demo available on the website showcases various stylistic customizations that users can apply to their QR codes.

- QRSVG converts QR code data into customizable SVG markup.

- It allows for shape and color customization of QR codes.

- Users can download QR codes in SVG and PNG formats.

- The project is entirely client-side and can be hosted as static files.

- It aims to provide a free alternative to existing QR code generators with fewer restrictions.

AI: What people are saying
The comments on the QRSVG project reveal various user experiences and alternatives in QR code generation.
  • Several users recommend alternative libraries and tools for generating QR codes, such as the 'qrcode' library and Anthony Fu's QR Toolkit.
  • Users share personal experiences, including frustrations with QR code services that impose fees after a certain usage limit.
  • There is a discussion about the advantages of SVG versus bitmap formats for QR code storage.
  • Some comments express appreciation for the QRSVG project and its integration with existing libraries.
  • Users highlight the importance of controlling QR code URLs to avoid unexpected costs.
Link Icon 14 comments
By @toddmorey - about 2 months
One of my favorite components from the open source web components library Shoelace is the QR code generator: https://shoelace.style/components/qr-code
By @boomskats - about 2 months
This looks great! Wish I had it a few months ago instead of having to use qr-code-styling[0] which was a bit of a pain.

I remember it was around the same time that Obsidian got native callouts, so my notes for that project are all colourful & contain valuable admonitions like this:

```

> [!todo]

> That feeling when you're wasting hours of your life trying to make something you know is abandonware work just because it looks nice. There should be a word for that feeling. In Danish or Japanese. Or German.

```

[0]: https://github.com/kozakdenys/qr-code-styling

By @pikminguy - about 1 month
If you're looking for a non web QR generator with lots of options try Zint. https://www.zint.org.uk/ It's the only option I have found that doesn't seem to lock out any features. You want to control the error correction? Got it. Render in color? No problem. Batch convert 1000 lines of text into 1000 individual images. It took less than a second. It even does Datamatrix and other non QR encodings.
By @declan_roberts - about 2 months
USE THIS SOFTWARE AND LEARN FROM MY MISTAKE:

We made a cute Christmas video to include in our card this year. My wife created a QR code from a random website and included it in the card as a picture. It linked to our video. We sent all of the cards out. People loved it.

... except we got an email from the QR code company about a week before Christmas. We went over our "free" click (the QR code went through their URL shortener). If we wanted to keep the QR code active we had to pay $20/mo.

We got absolutely fleeced. Never again. Control the URL and make the QR image yourself.

By @nayuki - about 2 months
Thank you for building this wonderful UI on top of my library!
By @KTibow - about 2 months
If you stumbled upon this looking for the smallest QR code JS library, it's probably LeanQR [0]. It's under 10kb minified and 5kb compressed.

[0] https://qr.davidje13.com/

By @Techbrunch - about 2 months
I found that Anthony Fu's QR Toolkit is a great alternative: https://qrcode.antfu.me/
By @davchana - about 2 months
Pretty great example, but I was bummed to see that Error Level is missing. I like to create easy codes with low error correction.
By @jillesvangurp - about 2 months
I've been using this library: https://www.npmjs.com/package/qrcode.

Works great and it does svg too. There are a few alternatives to this around as well but this one seems good enough.

By @butz - about 2 months
Isn't this one of those rare occasions where bitmap file format is more optimal for storing output?
By @Narhzih - about 2 months
You can try https://app.y.gy. It's not a library, but they have an API for link-shortening and QR Code Generation.
By @kentbrew - about 2 months
"The demo on this page combines Project Nayuki’s QR Code generator library (a multi-language open source project that can, among other things, perform the conversion of text into raw QR code data) with my own QRSVG project, which can turn a QR-like two-dimensional boolean data map into an efficient vector description of its own visualization by tracing the contours of contiguous shapes."
By @the_arun - about 2 months
For some reason in my phone camera - "Open in browser" is not showing up if background is dark.
By @eaq - about 2 months
For local use, this Python library can generate SVGs with QR codes: https://github.com/lincolnloop/python-qrcode