Page 1 of 1
IMagick Smooth Rounded Corners on QR Code??
Posted: 2012-03-09T03:22:30-07:00
by lordchapman
Hi There. I am currently using a median filter to create a rounded corners effect on a QR Code which results in this result:
- QR With Median
- qrCode-hwrfrgs-1331288078-X.png (12.58 KiB) Viewed 14189 times
But I need it to look like this:
- QR Smooth
- unitag_qrcode.png (21.48 KiB) Viewed 14189 times
Nice and smooth corners. Whats the best way to achieve this?
Any help greatly appreciated!
Re: IMagick Smooth Rounded Corners on QR Code??
Posted: 2012-03-09T07:44:36-07:00
by lordchapman
Can anyone help?
Re: IMagick Smooth Rounded Corners on QR Code??
Posted: 2012-03-09T08:26:08-07:00
by Bonzo
There was a similar question about this late last year. You could try searching the users and developers section. The code would need to be adapted to Imagick.
Re: IMagick Smooth Rounded Corners on QR Code??
Posted: 2012-03-09T08:40:07-07:00
by lordchapman
Thanks for your reply!
Ive checked that out but it isnt very clear at all. Just wondered if someone could shed some more light on it..
Re: IMagick Smooth Rounded Corners on QR Code??
Posted: 2012-03-14T23:39:54-07:00
by anthony
You could try using a Morphology Close with a 'Disk' of the desired radius (not too big).
http://www.imagemagick.org/Usage/morphology/#close
however as you are using a white background you will need to use the 'complementary' method, Open
http://www.imagemagick.org/Usage/morphology/#Open
The examples shown in the above does not do the operation justice, but the Wikipedia page shows its effect on square corners.
http://en.wikipedia.org/wiki/Closing_%28morphology%29
Actually you may need to do both Close and Open to get the total overall effect, one to round off corners, the other to round of the bridges between diagonal points. Doing both is known as a 'Smooth' Morphological operation
http://www.imagemagick.org/Usage/morphology/#smooth
But you may need to re-order the operations for the white background.
Hey you wanted 'smooth'!... Well their you go. "Smooth" is the name of the operation!
Of course please report on how sucess or failure.
PS: a more general problem like this can be made to the Users forum. With perhaps a copy of the
original image!
Others will then try out things and show you results, typically using the command line API. Translating the Shell API back to IMagick API on the other hand is a different matter.
I do not know if IMagick API is up-to-date enough to have access to the morphology methods, but thw MagickWand API is.