Package qrcode implements a QR Code encoder

go-qrcode

Package qrcode implements a QR Code encoder. Build Status

A QR Code is a matrix (two-dimensional) barcode. Arbitrary content may be encoded, with URLs being a popular choice :)

Each QR Code contains error recovery information to aid reading damaged or obscured codes. There are four levels of error recovery: Low, medium, high and highest. QR Codes with a higher recovery level are more robust to damage, at the cost of being physically larger.

Install

go get -u github.com/rjrishabhjain09/qrcode...

A command-line tool qrcode will be built into $GOPATH/bin/.

Usage

import qrcode "github.com/rjrishabhjain09/qrcode"
  • Create a 256x256 PNG image:

      var png []byte
      png, err := qrcode.Encode("https://example.org", qrcode.Medium, 256)
    
  • Create a 256x256 PNG image and write to a file:

      err := qrcode.WriteFile("https://example.org", qrcode.Medium, 256, "qr.png")
    
  • Create a 256x256 PNG image with custom colors and write to file:

      err := qrcode.WriteColorFile("https://example.org", qrcode.Medium, 256, color.Black, color.White, "qr.png")
    

All examples use the qrcode.Medium error Recovery Level and create a fixed 256x256px size QR Code. The last function creates a white on black instead of black on white QR Code.

Documentation

godoc

CLI

A command-line tool qrcode will be built into $GOPATH/bin/.

out.png ">
qrcode -- QR Code encoder in Go
https://github.com/skip2/go-qrcode

Flags:
  -d	disable QR Code border
  -i	invert black and white
  -o string
    	out PNG file prefix, empty for stdout
  -s int
    	image size (pixel) (default 256)
  -t	print as text-art on stdout

Usage:
  1. Arguments except for flags are joined by " " and used to generate QR code.
     Default output is STDOUT, pipe to imagemagick command "display" to display
     on any X server.

       qrcode hello word | display

  2. Save to file if "display" not available:

       qrcode "homepage: https://github.com/rjrishabhjain09/qrcode" > out.png

Maximum capacity

The maximum capacity of a QR Code varies according to the content encoded and the error recovery level. The maximum capacity is 2,953 bytes, 4,296 alphanumeric characters, 7,089 numeric digits, or a combination of these.

Similar Resources

Graphics-go - back for code.google.com/p/graphics-go

This is a Graphics library for the Go programming language. Unless otherwise noted, the graphics-go source files are distributed under the BSD-style

Jan 1, 2022

Snippit - Creates syntax-highlighted code snippets in png or svg format

Snippit - Creates syntax-highlighted code snippets in png or svg format

snippit creates syntax-highlighted code snippets in png or svg format. Installat

Oct 10, 2022

Code for creating GIF replays of games played on Woogles.io.

woogles-game-gifs Code for creating GIF replays of games played on Woogles.io. Requirements Go is required to run the gif generator. To install, refer

Jan 31, 2022

A pure Go package for coordinate transformations.

WGS84 A pure Go package for coordinate transformations. go get github.com/wroge/wgs84 Usage east, north, h := wgs84.LonLat().To(wgs84.ETRS89UTM(32)).R

Nov 25, 2022

Go package for fast high-level image processing powered by libvips C library

bimg Small Go package for fast high-level image processing using libvips via C bindings, providing a simple programmatic API. bimg was designed to be

Jan 2, 2023

Go bindings for GStreamer (retired: currently I don't use/develop this package)

Retired. I don't use/develop this package anymore. Go bindings for GStreamer at a very early stage of maturity. This package is based on GLib bindings

Nov 10, 2022

Imaging is a simple image processing package for Go

Imaging is a simple image processing package for Go

Imaging Package imaging provides basic image processing functions (resize, rotate, crop, brightness/contrast adjustments, etc.). All the image process

Dec 30, 2022

Go package for decoding and encoding TARGA image format

tga tga is a Go package for decoding and encoding TARGA image format. It supports RLE and raw TARGA images with 8/15/16/24/32 bits per pixel, monochro

Sep 26, 2022

Go package for computer vision using OpenCV 4 and beyond.

Go package for computer vision using OpenCV 4 and beyond.

GoCV The GoCV package provides Go language bindings for the OpenCV 4 computer vision library. The GoCV package supports the latest releases of Go and

Jan 1, 2023
Related tags
Pbm - Package ppm implements a Portable Bit Map (PBM) image decoder and encoder written in Go

Package pbm import "github.com/slashformotion/pbm" Package pbm implements a Portable Bit Map (PBM) image decoder and encoder. The supported image col

Jan 5, 2022
Golang implementation of the covid certificate QRCode decoder

Golang implementation of the covid certificates. At the moment it only includes DCC signed data decoding but I've planned to add a lot more of features related to certificates processing.

Sep 22, 2021
Gerador Pix Copia e Cola / QRCode em Golang
Gerador Pix Copia e Cola / QRCode em Golang

Gerador Pix Gerador Pix Copia e Cola / QRCode em Golang Fiz este gerador para um projeto pessoal, talvez eu transforme em um pacote no futuro. Fique a

May 25, 2022
Rich TIFF/BigTIFF/GeoTIFF decoder/encoder for Go (Pure Go/Zero Dependencies)

Go语言QQ群: 102319854, 1055927514 凹语言(凹读音“Wa”)(The Wa Programming Language): https://github.com/wa-lang/wa TIFF for Go Features: Support BigTiff Support

Nov 16, 2022
WebP decoder and encoder for Go (Zero Dependencies).
WebP decoder and encoder for Go (Zero Dependencies).

Go语言QQ群: 102319854, 1055927514 凹语言(凹读音“Wa”)(The Wa Programming Language): https://github.com/wa-lang/wa webp ██╗ ██╗███████╗██████╗ ██████╗ ██║

Dec 28, 2022
Pure Go encoder/decoder of the QOI image format

QOI - The “Quite OK Image” format for fast, lossless image compression package and small utilities in native Go, quite OK implementation See qoi.h for

Nov 12, 2022
Go package captcha implements generation and verification of image and audio CAPTCHAs.
Go package captcha implements generation and verification of image and audio CAPTCHAs.

Package captcha ⚠️ Warning: this captcha can be broken by advanced OCR captcha breaking algorithms. import "github.com/dchest/captcha" Package captch

Dec 30, 2022
This is old and unmaintained code, ignore it. starfish is a simple, SDL based, 2D graphics and user input library for Go. If you intend to work on it, please fork from the 'devel' branch, not 'master'. Current release: 0.12.0

What is starfish? What starfish is: starfish is a simple 2D graphics and user input library for Go built on SDL. What starfish is not: While it is bui

Jun 4, 2019
code2img can generate image of source code
code2img can generate image of source code

code2img code2img can generate image of source code. This was inspired by carbon and silicon Features Doesn't need browser & Internet Copy image of so

Nov 15, 2022
A festive Christmas tree GIF generator implemented using only Golang standard library code
A festive Christmas tree GIF generator implemented using only Golang standard library code

Christmas Tree GIF Generator A festive Christmas tree GIF generator implemented

Feb 4, 2022