9

I have a barcode image. I have to make it smaller.

Can that damage the barcode?

  1. Proportional scaling

  2. Not proportional scaling (only height changes)

Barcodes are: Type UPC-A / EAN-13 "vertical lines". Sorry not an expert in barcodes, thought the type of barcode would not be important. Scaling is moderate, the image does not lose relevant data.

Giacomo1968
  • 25,759
  • 11
  • 71
  • 103
User
  • 31,811
  • 40
  • 131
  • 232
  • Which Barcode ? There are many types (EAN 13, EAN 8, etc.) – int2000 May 18 '12 at 09:53
  • How much scaling ? What kind of barcode ? Without more information, of course scaling with damage your image, since it induces of loss of data. – ClemKeirua May 18 '12 at 09:54
  • 2
    UPC-A / EAN-13. Sorry not an expert in barcodes, thought the type of barcode would not be important. Scaling is moderate, the image does not lose relevant data (like line dissapearing or something). – User May 18 '12 at 09:57

3 Answers3

5

For regular linear product barcodes, the simple answer is yes, you can scale it (both case are safe).

However, if you scale too far and the bars end up too close together, you will start to get a high level of read errors.

You'll need to test it with an appropriate barcode reader to make sure you haven't scaled too much.

Rik Heywood
  • 13,816
  • 9
  • 61
  • 81
  • Yes, scaling is moderate. I just thought maybe the dimensions or propotions were some kind of information for themselves, so changing them would alter what the scanner reads. – User May 18 '12 at 10:01
  • +1 because your answer is helpful bot the other one is more concrete. – User May 18 '12 at 10:04
5

Regular barcode (=vertical stripes) is recognized by the relative width of the lines. Thus, the horizontal height only matters for robustness against diagonal scanning. If the codes are scanned with a hand scanner, I'd just scale the height (or crop the image). In any case, the different widths of the lines should still be clearly visible. There may be compliance rules suggesting minimum proportions for a given barcode standard.

Stefan Haustein
  • 18,427
  • 3
  • 36
  • 51
0

When scaling a barcode, there are several things you must keep in mind.

1) You get the absolute sharpest edges in a barcode if each module (the narrowest bar) is a whole number of pixels wide.

2) If the module width is not a whole number of pixels, produce a barcode where the width of each module is the truncated whole number and use bilinear interpolation to scale up. This will give you at most one pixel of gradient at the edges.

3) Be careful when buying a barcode library, choose one that includes built-in scaling that preserves the barcode, such as this one or this one. Barcodes have special demands that image processing normally does not have, such as pixel-perfection. Using e.g. Gimp might damage the barcode.

June7
  • 19,874
  • 8
  • 24
  • 34
Martin Johansen
  • 131
  • 1
  • 4