Does barcode image zoom out?

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

Could this damage the barcode?

  • Proportional scaling

  • Not proportional scaling (only change of height)

Barcodes: Type UPC-A / EAN-13 "vertical lines". Sorry, not a barcode specialist, I thought that the type of barcode would not be important. The scaling is moderate, the image does not lose the corresponding data.

+6
source share
3 answers

A regular barcode (= vertical stripes) is recognized by the relative line width. Thus, horizontal height is important only for resistance to diagonal scanning. If the codes are scanned using a hand scanner, I would simply increase the height (or crop the image). In any case, different line widths should be clearly visible. There may be compliance rules offering minimal proportions for a given barcode standard.

+3
source

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

However, if you scale too far, and the bars are too close to each other, you will begin to get a high level of read errors.

You will need to test it with the appropriate barcode reader to make sure you scale too little.

+3
source

There are a few things to keep in mind when scaling a barcode.

1) You get the absolute coolest edges of the barcode if each module (the narrowest strip) has an integer number of pixels wide.

2) If the module width is not equal to an integer number of pixels, create a barcode with a truncated pixel width and use bilinear interpolation to zoom in. This will give you no more than one pixel of gradient along the edges.

3) Be careful when purchasing a barcode library, choose one that includes built-in scaling with saving a barcode, for example, this or this . Barcodes have special requirements that are not usually found in image processing, such as pixel perfection. Using, for example, Gimp can damage the barcode.

0
source

Source: https://habr.com/ru/post/916079/


All Articles