Max size of datamatrix code

Is there a max cell size for datamatrix codes for reading in cvb barcode?

One of these can be read, and the other cannot. Both are scaled images of the original, and have perfect contrast. So, this leads me to the question if perhaps there is a max size of either the cells or the datamatrix as a whole. Is this indeed the case?

Hm. Can you paste the image zipped in a lossless format like e.g. *.png? The two images you pasted have been stored by the forum software in *.jpg format and therefore no longer have perfect contrast, making it hard for me to look into the issue:

In fact I cannot even tell for certain what the difference between both images is - the size is identical and the difference image does not give a clear indication of what the difference between both images is - the visible difference might as well be jpg artifacts. Currently I can read both images without tweaking any parameters.

Technically there is no upper limit to the cell size (which is often called “module size”) in :cvb: Barcode, however I am pretty sure that at some point the algorithm for finding the codes will fail to find them no matter how perfect the contrast is. We do specify an absolute minimum module size of 2, i.e. no Datamatrix code with less than 4 pixels per small block should be expected to be read and no 1D code with the narrow bars (or gaps) with less than 2 pixels across should be expected to be read even if the contrast is perfect. Our recommendation is to use a module size of 5 when reading Barcodes or Matrix codes and grading requires around 10 (you will get grading results even if the module size is much less than 10, but usually these results will fluctuate a lot and won’t be very useful).

Both of your codes seem to have a module size of close to 20, so they should read, however you should watch the quiet zone: The Datamatrix specification requires at least one module size of quiet zone around the code and both images seem to be a bit of a borderline case in that respect (which might also be the reason why the original images pose a problem and the images degraded by jpg compression don’t…).

Hmm, seenms like there is some additional compression by the forum? Seems like it reduces the size of images (and which would explain whyyou can read them just fine, smaller datamatrix codes are read just fine!)
This is the quality Im looking at;

The bigger image, perfect 90 has a resolution of 1080x1080, and perfect80 has a resolution of 960x960. Indeed, this difference is minimal.

Small image reads just fine;

bigger image does not :thinking:

Added a .zip to overcome the limitations of the forum. After several attempts, I found out that the forum simply reduces any image to below 500x500.

barcode (4.6 KB)

Ok, now I see it too… With module size 45 reading the code almost works :wink: - the tool finds the code (but apparently not well enough to read it), correctly identifies it as a Datamatrix but then fails to decode it:

I have not found a way to tweak the settings to get this code read, nor did increasing the quiet zone change anything, so it seems that with module size 45 the codes are no longer readable, no matter how good your contrast is. So the only suggestion I could give if you run into that problem in a real-world application is to shrink the image size (or buy a lower resolution camera :wink:) with CreateImageMap or CreateMatrixTransformedImage

Sorry for that - and merry Christmas :christmas_tree: