MultiMote / niimblue

đŸ–¨ Niimbot web ui. Design and print labels on Niimbot printers directly from web browser! Still in development.
https://niim.mmote.ru
MIT License
35 stars 6 forks source link

Barcodes are blurry #21

Open MultiMote opened 3 days ago

MultiMote commented 3 days ago

To make Barcode easily recognizable, it must have sharp edges.

At the moment, it's blurry:

vivaldi_U8JlEyahAI

To make this possible, explicit barcode scale levels must be defined. Free scaling must be disabled. Rendering code should be changed too.

Đ¡ertain canvas aspects should be taken into consideration.

Also applies to QR Codes.

tywtyw2002 commented 3 days ago

Hit: Do not use grey scale for barcode, use BW ONLY for barcode. In most case, BW free scale 1D barcode still detect by scanner.

MultiMote commented 3 days ago

@tywtyw2002 grayscale is a side effect of sub-pixel rendering (canvas has floating point coordinates) Drawing pixel-perfect objects is tricky.

Anyway, image is converted to BW after post-processing, but barcode should be sharp before it. Otherwise it will be broken in most cases (especially for the dense barcodes).