Hi There. I am currently using a median filter to create a rounded corners effect on a QR Code which results in this result:
But I need it to look like this:
Nice and smooth corners. Whats the best way to achieve this?
Any help greatly appreciated!
IMagick Smooth Rounded Corners on QR Code??
-
- Posts: 3
- Joined: 2012-03-09T03:14:06-07:00
- Authentication code: 8675308
-
- Posts: 3
- Joined: 2012-03-09T03:14:06-07:00
- Authentication code: 8675308
Re: IMagick Smooth Rounded Corners on QR Code??
Can anyone help?
Re: IMagick Smooth Rounded Corners on QR Code??
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.
-
- Posts: 3
- Joined: 2012-03-09T03:14:06-07:00
- Authentication code: 8675308
Re: IMagick Smooth Rounded Corners on QR Code??
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..
Ive checked that out but it isnt very clear at all. Just wondered if someone could shed some more light on it..
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: IMagick Smooth Rounded Corners on QR Code??
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/