Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What Image format should I use for barcodes created on the fly

I'm creating barcodes on the fly, and embedding them in web pages. What format should I use? I'm wavering between JPG and PNG, and I don't really understand the advantages of both. Size matters in this, as does readability (better a clear barcode than a blurry one). Is there another format that would be better yet?

like image 551
C. Ross Avatar asked Nov 28 '22 23:11

C. Ross


1 Answers

PNG, or even GIF. Jpeg is right out, because it's designed for the smooth gradients of photographs, not the sharp edges of bar codes. Draw a simple Bar code by hand in MS Paint, save it, and then reload it, you'll see all kinds of compression artifacts.

like image 57
Aric TenEyck Avatar answered Jan 09 '23 14:01

Aric TenEyck