I'm trying to create my own QR Code Generator library and algorithms. I made a little research about the steps of creating a QR Code, but got stuck with this ambiguous point.
Error Correction Level are listed as following:
- Level L (Low) 7% of data bytes can be restored.
- Level M (Medium) 15% of data bytes can be restored.
- Level Q (Quartile) 25% of data bytes can be restored.
- Level H (High) 30% of data bytes can be restored.
In QR Codes Black = 1 & White = 0
According to Wikipedia this how levels are coded
- L : 3 (11 binary) -> (2 Black squares)
- M : 2 (10 binary) -> (1 Black & 1 White)
- Q : 1 (01 binary) -> (1 White & 1 Black)
- H : 0 (00 binary) -> (2 White squares)
According to lots of other Websites & Tutorials this how levels are coded
- L : 1 (01 binary) -> (1 White & 1 Black)
- M : 0 (00 binary) -> (2 White squares)
- Q : 3 (11 binary) -> (2 Black squares)
- H : 2 (10 binary) -> (1 Black & 1 White)
Which one do I trust or I have missed a critical step or something to identify that
The Answer is BOTH, yes both are correct but are a different phases:
The one in Wikipedia show how the Error Correction Level is displayed on a READY QR CODE (final preview)
The others show how the Error Correction Level should look like Before MASK
So the final result would look like the following: