I get a QRCode png as base64 from a remote service and need to display it on the web. When blowing the picture up without the “vector” data, it blurs:
I write the base64 to disk with
fwrite($ifp, base64_decode($this->getQRCode()));
The resulting png is a bit small (29×29 pixels). When I open it with e.g. Photoshop, I can blow it up without loss so it looks like the “vector” data is intact. Note the “pixels”:
How can I do this on the server side before writing it down to disk and linking to it from the web.
2
Answers
The old school way of blowing up images was to (ideally) double pixels. Smoothing the rough edges that were the result of that process was invented later. So now I go with this:
You don’t say how you are “blowing the picture up.” Have you tried rescaling the image in PHP?
Edit: you can try various interpolation modes as specified here, if
IMG_NEAREST_NEIGHBOUR
isn’t suitable. (Also, note the British/Canadian spelling of neighbour.)