Rob Agar
Rob Agar

Reputation: 12459

QR Code MIME Type

Is there a commonly recognised MIME type specifically for QR code images, beyond the generic image/png (assuming png is the format)?

Upvotes: 3

Views: 2781

Answers (2)

mer2329
mer2329

Reputation: 177

a qr code is just the code, not the file format.

you could save it as a bmp, jpeg, gif and it would still work.

but png works best for qr codes because of the way it compresses, plus its lossless so it scales without blurring.

heres why. jpg is a lossy format, meaning you loose quality with compression. it is geared for full color photographs. bmp is lossy but and is also geared to photographs, it can be lossless but the file is huge. png, is lossless, compression is done similar to a zip archive. it is geared to simple images, but can handle complex images. it is not meant for photographs. and works wonderfully with qr codes. PNG can be compressed by removing colors from the color index.

to start with i created a barcode with zint with the URl of this question QR Code MIME Type

next i opened it in gimp and saved it as a bmp its file size was 129 KB for the bmp i left all options at default in gimp. a JPG at 100 % quality resulted in a 21.4 KB file a jpg at 75 % quality resulted in a file size of 12.3 KB a jpg with 50% quality resulted in a size of 9.90 KB a jpg with 20% quality resulted in a size of 7.79 KB a GIF with default settings resulted in a size of 2.43 KB a PNG with the default options resulted in 1.12 KB a optimised PNG (Using R.I.O.T) resulted in a file size of 420 bytes
for reference my riot settings were
color reduction = dithered monochrome compression maximum

heres the BMP
pic

heres the JPG @ 25%
pic

heres the gif
pic

heres the PNG at default settings
pic

heres the optimised PNG
pic

scan any of these and they will work (a more compressed jpg may not work because of the introduced noise)

Upvotes: 0

BenM
BenM

Reputation: 53208

No. A QR Code isn't a file type any more than a barcode. The MIME type should be that of the file containing the QR Code.

Upvotes: 2

Related Questions