# \[ANN\] Coder and Decoder of QR codes

**URL:** <https://discourse.julialang.org/t/ann-coder-and-decoder-of-qr-codes/88087>\
**Category:** Package Announcements\
**Created:** [October 1, 2022, 1:56pm UTC](https://discourse.julialang.org/t/ann-coder-and-decoder-of-qr-codes/88087 "2022-10-01T13:56:00Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Rex\_Wang](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rex_wang/32/35108_2.png) [@Rex\_Wang](https://discourse.julialang.org/u/Rex_Wang)\
**Post date:** [November 26, 2022, 6:06pm UTC](https://discourse.julialang.org/t/ann-coder-and-decoder-of-qr-codes/88087/2 "2022-11-26T18:06:04Z")

</div>

I’m happy to discuss with you the recent work of [QRCoders](https://github.com/JuliaImages/QRCoders.jl)!! Most of them follow the suggestions of a previous [discussion (2019)](https://discourse.julialang.org/t/ann-qrcode-jl-create-qr-code-within-julia/). Now I am writing this post for more advice.  
Moreover, if you also find these ideas interesting, welcome to contribute! Feel free to give your valuable suggestions to help improve this package!

## New features:

1. Introduce a new type `QRCode` as suggested by @c42f in the [comment](https://discourse.julialang.org/t/ann-qrcode-jl-create-qr-code-within-julia/26923/25). The new type do help in the design of styles!

2. Unicode plot, either by UnicodePlots.jl suggested by @carstenbauer, or by Unicode characters `['█', '▀', '▄', ' ']` mentioned in [issue#25](https://github.com/JuliaImages/QRCoders.jl/issues/25)  

3. Add support for `.jpg` and `.gif` images

More importantly, the styling plan is drawn on the schedule! Here is a draft.

 ![yangshi](https://global.discourse-cdn.com/julialang/original/3X/b/a/bafd197b2965f36d0c9956240bea49e1d970f6e7.png)

## Pixel drawing

Most of the QR code styles follow the same strategy: First build the QR code, then beautify the image.

However, _pixel drawing_ use a strategy of **free-bits-calculation and error-correction-bits-modification** , to similar the image by real QR-bits. This requires some decoding tricks. In this regard, I am very much grateful to [Saar Ibuki](https://github.com/ibukisaar) for the helpful and creative advice.

Here are applications by _pixel drawing_:

1. Direct drawing

2. Enlarging _the logo in the center of an image_  

3. Playing games – Tetris  

4. Playing videos – BadApples  

5. More idea, like Nest QR codes  

Due to my limited time and energy, I am currently focusing on the implementation of this part only. _When QRCoders can plot images, it can play everything in fact!_

## Strategies for other styles

1. Colorful QR Code

2. Scatter plot: use `scatterplot` from [UnicodePlots](https://github.com/JuliaPlots/UnicodePlots.jl), or use the Kronecker product `kron` which served as a map of _pixels_ to _matrices_

3. Theme plot, like the Pac-Man  

* * *

BTW, the style plan proposed in [issue#33](https://github.com/JuliaImages/QRCoders.jl/issues/33) is also asked in the juliacn-meetingup-[website](https://cn.julialang.org/meetup-website/).  
If you have good ideas suitable for newcomers, welcome to the [bounty issue](https://github.com/JuliaCN/meetup-website/issues/1) to ask more questions. 😀

---

_[View the full topic](https://discourse.julialang.org/t/ann-coder-and-decoder-of-qr-codes/88087)._
