forked from yeqown/go-qrcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add document for compressed writer
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## Compressed Writer | ||
|
||
[](https://pkg.go.dev/github.com/yeqown/go-qrcode/writer/compressed) | ||
|
||
Compressed Writer is a writer that is used to draw QR Code image on a very small scale. | ||
Since the compressed writer would only use a two-tone palette to generate the image, | ||
and automatically compressed in PNG format. | ||
|
||
Check codes for more details about compress principle. | ||
|
||
### Usage | ||
|
||
```go | ||
option := compressed.Option{ | ||
Padding: 4, // padding pixels around the qr code. | ||
BlockSize: 1, // block pixels which represents a bit data. | ||
} | ||
|
||
w, err := compressed.New(name, &option) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
if err := qrc.Save(w); err != nil { | ||
panic(err) | ||
} | ||
``` |