0

How to generate 300dpi QR code using PHP QR Code Library ? They have size ranged from 1-40, with maximum size 984px (72dpi). My client wants me to work on a program that can generate printable version, which requires 300dpi and at least 5 inches of each side.

Charles
  • 50,943
  • 13
  • 104
  • 142
Raptor
  • 53,206
  • 45
  • 230
  • 366
  • Why do you need 300 dpi for print output? Just because the printer has such a resolution? There is not enough information in a qrcode to require such resolution. Just generate a "normal" qrcode and increase it in size when you include it in a print layout. – arkascha Oct 15 '12 at 11:21
  • 5 inch at 300 dpi ?? that is 1500 x 1500 = `2250000 pixels` ??? Do you think using PHP would be the best option for this ??? – Baba Oct 15 '12 at 11:25
  • 1
    It is a simple calculation, just scale the image by factor 4.1666... and then set/change any DPI setting if such a meta value exists with the file-format you create. I don't understand what causes you any problem with that. – hakre Oct 15 '12 at 11:28
  • @hakre I don't think just change Dip in meta .. it needs to be part of image generation .... it affect the whole pixel numbers – Baba Oct 15 '12 at 11:42

2 Answers2

3

They have size ranged from 1-40, with maximum size 984px (72dpi)

No, they do not specify the DPI. DPI is an interpretation of the picture which can be specified at will.

An image has a given amount of pixels and a DPI suggestion, the DPI is not an intrinsic property of the pixel based image.

If you want a 5 by 5 inches picture at 300dpi, you simply need to have a 1500 by 1500 pixel image.

phant0m
  • 16,595
  • 5
  • 50
  • 82
1

I work for a commercial printer, and I can assure you that there is no benefit to generating a QR code at 300dpi.

While 300dpi is the generally-recommended resolution for printing raster graphics, this is because each dot is so tiny when printed that it is almost indistinguishable to the human eye, so (together with anti-aliasing) the tiny dots in a curve will make the curve look smooth.

However, since there are no curves in a QR Code, they can simply be scaled up. They look exactly the same at 300dpi as they do at 72dpi.

Kalessin
  • 2,282
  • 2
  • 22
  • 24
  • 4
    *"I work for a commercial printer"* - It's amazing to me that we as a race have finally reached the point in which we are working for machines. Neo would not approve :D – Ed S. Oct 16 '12 at 05:32