JuliaImages / QRCoders.jl

Creating QR Codes within Julia
https://juliaimages.org/QRCoders.jl/
MIT License
68 stars 11 forks source link

Q: Source code for repository logo #52

Open kakila opened 1 year ago

kakila commented 1 year ago

Hi,

Thanks for the package! I was trying to recreate the image you use as the logo for the repository and haven't suceeded yet. Is there source code showing how to generate it?

Thanks again

RexWzh commented 1 year ago

Hello @kakila . The code for generating QR codes was written last year, and I haven't been able to find it at the moment. However, you can find basic instructions in the README:

using TestImages, ColorTypes, ImageTransformations
using QRCoders
oriimg = testimage("cameraman")
code = QRCode("Hello world!", version=16, width=4)
img = imresize(oriimg, 66, 66) .|> Gray .|> round .|> Bool .|> !
imageinqrcode(code, img; rate=0.9) |> exportbitmat("qrcode-camera.png")

You can modify the image, size of the QR code, and other related information there. Additionally, please note that the project currently only supports embedding binary images. While it is simple to restore the original colors of the image, I plan on creating a function for this when I am available.