Hello,
I've had success creating a cool vanity QR code with rounded edges for my organization by generating a standard QR code, then applying a noise -> median effect in Photoshop to get the edges rounded among some other effects.
Photoshop is great, but I want to automate this. I found a great PHP library to generate QR codes. The part I don't get is the rounding of the hard edges.
I've seen other sites do it like this one.
Any thoughts on how to do this with ImageMagick+PHP? While familiar with GD, I just started playing with ImageMagick. It's like I'm drinking from a fire hose of possibilities right now! I'm reading this page and something with morpholigy looks potential. Newbie guidance is welcome.
Best regards,
Chris
[Solved] rounding edges of QR code squares?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: rounding edges of QR code squares?
this is just a quick test:
convert 5754322905.GIF -morphology close disk:3 5754322905_close_disk3.gif
Can you provide links to how you generate your basic qr codes?
convert 5754322905.GIF -morphology close disk:3 5754322905_close_disk3.gif
Can you provide links to how you generate your basic qr codes?
- owntheweb
- Posts: 20
- Joined: 2011-05-24T06:30:15-07:00
- Authentication code: 8675308
- Location: Colorado
Re: rounding edges of QR code squares?
Cool! Thanks for the prompt, helpful response. At the moment I've been creating QR codes at http://qrcode.kaywa.com/ at XL size, then doubling the size in Photoshop (while keeping sharp edges) before applying the median effect.
I'm taking a quick ImageMagick/PHP tutorial now and will respond with some samples if you don't beat me to it.
EDIT:
It looks like Imagick is the interface API I have access to. I'm reading up on all the functions and how to convert command lines into function calls.
I'm taking a quick ImageMagick/PHP tutorial now and will respond with some samples if you don't beat me to it.
EDIT:
It looks like Imagick is the interface API I have access to. I'm reading up on all the functions and how to convert command lines into function calls.
Re: rounding edges of QR code squares?
You might be restricted with what Imagick can do; if so try with php exec( ) and the comand line. Some examples on my site.
- owntheweb
- Posts: 20
- Joined: 2011-05-24T06:30:15-07:00
- Authentication code: 8675308
- Location: Colorado
Re: rounding edges of QR code squares?
I got it! Much more fun to be had, but here's what I have:
Result:
I'm covered now. Thanks for the helpful info as I make steps forward on this.
Code: Select all
<?php
$im = new Imagick("starter.png");
$height = $im->getImageHeight();
$width = $im->getImageWidth();
$im->resizeImage($width * 2, $height * 2, Imagick::FILTER_POINT, 0);
$im->medianFilterImage(8);
header("Content-Type: image/png");
echo $im;
?>
I'm covered now. Thanks for the helpful info as I make steps forward on this.