paulmillr / qr

Minimal browser & node.js QR Code Pattern reader and generator
https://paulmillr.com/apps/qr/
Apache License 2.0
147 stars 5 forks source link

SVG optimization from <rect> to <path>? #11

Open imcotton opened 1 month ago

imcotton commented 1 month ago

The current SVG implementation generates multiple <rect> elements to render the bit blocks. I think it could be optimized by using a single <path d="..."> within the <svg> element.

This way could significantly reduce file size and improve efficiency, it may be worthwhile to look into.

paulmillr commented 1 month ago

Pull reqs are welcome!

imcotton commented 1 month ago

Disclaimer: I only bumped other libraries with this compact SVG rendering approach for QR codes. I'm not an expert on this very topic, so maybe someone with more experience or knowledge would take this on. Thanks!