ITF barcode is not decoded in tiff image, but decoded in JPG image
Closed this issue · 8 comments
I have an ITF barcode with 10 digits value.
When an scanned tiff image with ITF barcode, tried to decode this barcode, NO value is decoded.
But the same image, when scanned as JPG, and tried to decode, it is decoded successfully.
I am wondering why the image format, tiff or jpeg, effects the decoding of this ITF value.
Any inputs are appreciated.
Can you provide the JPG and TIFF files?
https://github.com/SanKumSan/testercr7/blob/main/sample_tiff.tif
Here is the tiff file with the same ITF barcode and it is not decoded by ZXing.
Note : Tiff has LZW compression.
Does the compression of the tiff effects the decoding behaviour ?
Does the image formats (tiff, jpeg, png and others) effects the decoding behaviour ?
Hello @micjahn ,
Are you able decode the sample tiff file for ITF barcode ?
Thanks
Sorry, I can't check it for the next three weeks.
Anyway, the file format doesn't affect the decoding success. Internally every image format is converted to Bitmap before decoding. Only the compression algorithm of the format can in some cases affect the bitmap quality (difference between lossless and not lossless compression).
I couldn't decode both of them if I used the original image size.
If I reduce the size to 75% both versions are successfully decoded.
I think the main problem is more or less the black-and-white ratio of the image and the pixel artifacts in the black areas.
Perhaps a real-world image with more content would give better results. Or you generally shrink the scanned image by 25% before decoding which reduces artifacts in the black areas.
Hello
Reducing the size of the barcode rectangle or the whole image has improved decoding.
Thanks