Comments (2)
Seems to work for me
$ qrencode -V
qrencode version 4.1.1
Copyright (C) 2006-2017 Kentaro Fukuchi
$ qrencode -t PNG -d 72 -o d72.png "test"
$ qrencode -t PNG -d 300 -o d300.png "test"
$ identify -verbose d72.png | grep -A3 Geometry
Geometry: 87x87+0+0
Resolution: 28.34x28.34
Print size: 3.06987x3.06987
Units: PixelsPerCentimeter
$ identify -verbose d300.png | grep -A3 Geometry
Geometry: 87x87+0+0
Resolution: 118.11x118.11
Print size: 0.736601x0.736601
Units: PixelsPerCentimeter
https://fukuchi.org/works/qrencode/
In 3.2.0 version notes:
"--dpi" (or "-d") option has been added to qrencode. This option set DPI information in an output PNG image. (Thanks to David Dahl)
The man-page or help does not seem to be as specific, but the dpi setting is metadata only. It does not affect pixel size (geometry).
-d NUMBER, --dpi=NUMBER
specify the DPI of the generated PNG. (default=72)
If you wanted to have a bigger pixel size instead to match the dpi (like I did), you can resample it with imagick
$ convert -units PixelsPerInch -interpolate Nearest -filter point -resample 300 d72.png d300-imagick-resample.png
$ identify -verbose d300-imagick-resample.png | grep -A3 Geometry
Geometry: 363x363+0+0
Resolution: 118.11x118.11
Print size: 3.07341x3.07341
Units: PixelsPerCentimeter
This yields the same "print size" as the 72 (default) dpi setting but with bigger pixel size.
the -interpolate
and -filter
options are needed so the resampling does not make the image blurry.
This does have the downside that the margins are also multiplied. Setting -m 0
or -m 1
with qrencode
might be desired.
You can also just specify the desired pixel size : convert -interpolate Nearest -filter point -resize 500 d72.png 500px.png
For full list of options with ImageMagick's -resize
see https://imagemagick.org/script/command-line-options.php#resize
So, this is not really a bug but a feature request for setting the desired pixel size and scaling the qr-code accordingly as I see it.
from libqrencode.
Mmm, okay. I will not question the usefulness of the --dpi option, but the only thing that ever mattered to me was the resolution of an image. That would be a useful addition!
Thank you for offering a workaround via imagemagick.
from libqrencode.
Related Issues (20)
- rMQR Support
- ANSI and UTF8 types do not display properly on Windows HOT 2
- Please mention SVG output option in usage summary
- [Build Failed] Please consider updating autotool scripts.
- The library doesn't respect the encoding standard HOT 1
- Generation of lib and dll for windows
- Optimal text segmentation HOT 1
- Generate a QR code image with logo HOT 5
- Detect type of image from extension
- qrencode does not work with local linux vt/console
- Is it possible to use QRcode_encodeData() with command line tool (qrencode)?
- input string beginning with "-" parsed as option HOT 4
- How to add qrencode libraries in Qt creator?
- Cmake error HOT 1
- libqrencode on Perl and on Windows
- Questionable interpretation of mask scoring criterion number 3 (finder pattern) HOT 2
- IS THIS PROJECT DEAD?
- What is the maximum string length for QRcode_encodeStringStructured? HOT 1
- Wrong constant in QRinput_encodeModeECI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libqrencode.