First generate a qr_code
with a higher ecl
level.
Then add the logo.
The maximum area of logo depends on the difference in ecl
level between the
version with and without logo.
The size of the logo is further restricted by its image ratio.
We shrink very wide or tall logos to make sure it still fits on the logo.
Arguments
- code
A
qr_code
object- logo
the path to a logo image file. Must be either
png
,svg
orjpeg
format.- ecl
the required error correction level for the QR code after overlaying the logo. Must be lower than the
ecl
in thecode
. Defaults to"L"
. The difference between theecl
set here and theecl
incode
determines the maximum area of the logo. For the largest logo, generatecode
withecl = "H"
and add the logo withecl = "L"
.- hjust
Horizontal position of the logo. The default of
"c"
indicates the centre of the QR code. Use"r"
to align the right side of the logo with the right side of the QR code. Use"l"
to align the left side of the logo with the right side of the two vertical finder patterns.- vjust
Vertical position of the logo. The default of
"c"
indicates the centre of the QR code.. Use"b"
to align the bottom of the logo with the bottom of the QR code. Use"t"
to align the top of the logo with the bottom side of the two horizontal finder patterns.