Conclusion
Colored QR codes (QRGB) present an innovative solution to the growing demands for data storage and transmission in various sectors. By significantly improving storage capacity and security, QRGBs represent a significant technological advance over traditional QR codes (QRGB).
In todayʹs digital age, the need to store and transmit large amounts of information efficiently has led to the development of advanced technologies such as colored QR codes. Below is a detailed rationale for why QRGBs represent a significant improvement over traditional QR codes.
Traditional black and white QR codes are limited by their data storage capacity. By using three layers of colors (red, green and blue), QRGBs can store up to three times more information in the same space. This is because each color can represent a different set of data, allowing information to be overlaid without increasing the physical size of the code.
QRGBs not only increase storage capacity, but also improve information security. Overlaying multiple layers of data can make it difficult to forge or manipulate code. Additionally, by having multiple channels of information, redundancy can be implemented, which increases the robustness of the code against damage or read errors.
QRGBs are especially useful in applications where the transmission of large amounts of data in limited spaces is required, such as in the packaging industry, digital business cards, and interactive advertising. They also have potential in areas such as document and banknote security, where the authenticity and integrity of information are crucial.
Although QRGBs are based on the RGB color model, compatibility with printers that use the CMYK model has been considered. This ensures that the codes maintain their integrity and are legible even when printed, overcoming one of the main challenges of implementing colored QR codes in the physical world.
The development of advanced decoding algorithms that can identify and separate the different color layers is an essential component of QRGBs. These algorithms allow current scanning devices, with minor software modifications, to accurately read and decode the information stored in QRGBs. The introduction of QRGBs represents a significant advance in QR code technology, offering substantial improvements in storage capacity, security and applicability. These codes are an
innovative solution to the increasing demands for data storage and transmission in various sectors.
Components of the QR Code.
QR codes for personalized marketing.
Using QR codes with images is a creative practice that has evolved over time. Although there is no single pioneer, several companies and developers have contributed to popularizing this technique. Some QR code generators with images include:
-Me-QR: This generator allows you to convert images into QR codes, which provides branding opportunities and greater user engagement.
-QRGateway: Offers advanced functions to create QR codes with images, such as access to promotions, itineraries or product information.
-Canva: Although it does not specialize in QR codes, Canva provides a free generator to create custom QR codes, including images.
-My QR Code: Provides a QR code generator with options to add logos, colors and styles to your QR codes.
In short, the combination of images and QR codes has been adopted by various tools and platforms, offering creative opportunities in marketing, art, and more.
The first QR code with an embedded image to gain public notoriety was not necessarily that of the BBC in London. In fact, the concept of inserting images or logos within QR codes was popularized on various QR code generation platforms such as QRhacker and Pageloot, which allowed users to personalize their codes with photos and logos to improve aesthetics and brand recognition. .
These tools not only allowed inserting images, but also modifying the colors and arrangement of the pixels of the code, which led to the creation of more attractive and functional QR codes. Although the creation of the first image QR code cannot be attributed to a single entity, the technology and services to do so were developed around 2012.
However, some of the early notable examples and tools that popularized this technique are:
-Amit Agarwal of Digital Inspiration:Amit Agarwal is known for his technology innovations and tutorials, including customizing QR codes with images and logos. His 2012 article on how to embed images in QR codes helped spread this practice.
-Platforms like QRhacker and Pageloot:These tools have allowed users to create custom QR codes with images since the early 2010s. QRhacker, for example, offered advanced QR code editing options, including the ability to embed photos.
Theoretical Framework on the creation of Color QR Codes (QRGB).
The use of colors to increase the capacity of QR codes has been the subject of several academic studies. Kato and Tan (2007) in their study "Pervasive 2D Barcodes Using Color Information" explore how QR codes can use colors to increase information density, discussing the possibility of using multiple colors to represent more data compared to traditional QR codes. in black and white (Kato & Tan, 2007). Liu and Qiao (2011) in "Enhancing QR Code Capacity with Color" discuss methods for increasing the data capacity of QR codes using color, presenting an approach that encodes additional information in different color channels and evaluating the effectiveness and limitations of this technique (Liu & Qiao, 2011). Choi and Woo (2012) in "Data Encoding Technique Using Color QR Code" propose a method for encoding additional data into QR codes using colors, including a comparative analysis with traditional QR codes and demonstrating how the use of color can significantly improve the ability of data (Choi & Woo, 2012). Fang (2011) discusses offline QR code authorization based on visual cryptography, suggesting the use of color techniques to improve security and capacity (Fang, 2011). Fu, Cheng, Liu, and Yu (2019) present a two-level information protection scheme using visual cryptography and QR codes with multiple decryptions, highlighting the usefulness of colors in data encoding for information protection (Fu, Cheng, Liu, and Yu (2019) , Liu & Yu, 2019). Lin (2016) develops a distributed secret sharing approach with cheater prevention based on QR codes, exploring the use of colors to increase security and informativeness (Lin, 2016). Liu, Yan, and Pan (2019) investigate color visual secret sharing for QR codes with perfect module reconstruction, demonstrating how colors can improve the density and security of QR codes (Liu, Yan, & Pan, 2019). Tan, Liu, Yan, Wan, and Chen (2018) propose a visual secret sharing scheme for color QR codes, evaluating the effectiveness of this technique in improving information capacity (Tan et al., 2018). Mishra (2016) in his thesis "Region Identification and Decoding Of Security Markers Using Image Processing Tools" also addresses the use of image and color processing techniques in the identification and decoding of security markers, providing additional context for the use of colors in QR codes (Mishra, 2016). These studies show that the use of colors in QR codes can significantly increase information density. However, the practical implementation of these techniques has not been widely adopted in the commercial field,and more research is still required to overcome the technical and scannability challenges associated with color QR codes.
On the other hand, the idea of overlaying three QR codes using RGB colors, as described here, could be an innovative extension of these concepts, offering greater storage capacity in a single QR code.
In today's digital age, the need to store and transmit large amounts of information efficiently has led to the development of advanced technologies such as colored QR codes (QRGB). This section presents a detailed rationale for why QRGBs represent a significant improvement over traditional QR codes.
-Definition and Limitations of Traditional QR Codes:A QR (Quick Response) code is a type of two-dimensional barcode that can store information efficiently and quickly. It was created in 1994 by the Japanese company Denso Wave for the automotive industry, although its use has spread to many other areas due to its versatility and storage capacity. Traditional QR codes are made up of a matrix of black and white modules (dots) that represent the encoded data (QRGB).
-Justification of Colored QR Codes (QRGB):Traditional black and white QR codes are limited by their data storage capacity. By using three layers of colors (red,greenandblue), QRGBs can store up to three times more information in the same space. This is because each color can represent a different set of data, allowing information to be overlaid without increasing the physical size of the code. QRGBs not only increase storage capacity, but also improve information security. Overlaying multiple layers of data can make it difficult to forge or manipulate code. In addition, by having multiple channels of information, redundancy can be implemented, which increases the robustness of the code against damage or reading errors (QRGB).
-Applications and Potential of QRGBs:QRGBs are especially useful in applications where the transmission of large amounts of data in limited spaces is required, such as in the packaging industry, digital business cards and interactive advertising. They also have potential in areas such as document and banknote security, where the authenticity and integrity of information are crucial. Although QRGBs are based on the RGB color model, compatibility with printers using the CMYK model has been considered, ensuring that the codes maintain their integrity and are readable even when printed (QRGB).
-Development of Decoding Algorithms:The development of advanced decoding algorithms that can identify and separate the different color layers is an essential component of QRGBs. These algorithms allow current scanning devices, with minor software modifications, to accurately read and decode the information stored in QRGBs. The introduction of QRGB represents a significant advance in QR code technology, offering substantial improvements in storage capacity, security and applicability (QRGB).
Theory of the additive RGB color system and its implementation in Color QR Codes (QRGB):
The RGB additive color system is based on the combination of red (Red), green (Green) and blue (Blue) light to create a wide range of colors. Combining these three colors in different intensities can produce any color in the visible spectrum.
The principle behind the RGB system is based on the way the human eye perceives color. Our eyes have three types of receptor cells, known as cones, that are sensitive to red, green and blue wavelengths. When light enters the eye, these cells activate to different degrees depending on the wavelength of the light, and the brain interprets the signals from these cells as color.
In the additive system, colors are created by adding light of different colors.
The primary colors of the RGB system (red, green and blue) are mixed to produce other colors by adding their intensities: Red + Green = Yellow, Red + Blue = Magenta, Green + Blue = Cyan, Red + Green + Blue = White. Each of these secondary colors is the result of the superimposition of two of the primary colors. When the three primary colors are mixed at their maximum intensity, they produce white light.
The RGB system is used in various technologies and applications, mainly in devices that emit light. Some examples include: electronic displays, computer monitors, televisions and mobile phone screens use the RGB system to produce color images. In image projection, video projectors use RGB lamps and filters to project color images onto a screen. LED lighting allows the creation of a wide range of colors by adjusting the intensity of the red, green and blue light-emitting diodes.
The use of the RGB additive system is theoretically justified by the nature of light and the way it interacts with the receptors in the human eye. Visible light is a small part of the electromagnetic spectrum and is made up of waves of different lengths. The cones in our eyes are sensitive to these different wavelengths and allow us to see colors. Red Sensitive Cones (L): Sensitive to long wavelengths (~564–580 nm). Green Sensitive Cones (M): Sensitive to medium wavelengths (~534–545 nm). Blue Sensitive Cones (S): Sensitive to short wavelengths (~420–440 nm). The combination of light from these three primary colors in different proportions allows our brain to perceive a wide range of colors.
The additive RGB color system (Red,Green,Blue) is a model used to create colors in electronic devices by combining light at different intensities, represented by values from 0 to 255. The primary colors are:Red (255, 0, 0),Green (0, 255, 0)andBlue (0, 0, 255). By mixing these colors you get: Red + Green =Yellow (255, 255, 0), Red + Blue =Magenta (255, 0, 255), and Green + Blue =Cyan (0, 255, 255).The combination of all colors producesWhite (255, 255, 255), while the absence of light generates Black (0, 0, 0). Other colors can also be obtained such as Orange (255, 165, 0) by mixing red and green, Light Green (144, 238, 144) and Light Blue (173, 216, 230) with specific proportions. The RGB system allows you to create a wide range of colors, essential for digital visualization and graphic design. But we will only focus on this one:
Methodology to be implemented in the creation and reading of QRGB Codes.
Three individual QR codes are created in the colors red, green and blue, each encoding different parts of the information. These QR codes are generated using Python tools and libraries like PyQRCode and OpenCV. QR codes in red, green and blue overlap to form a single colored QR code. This overlay process is done in the RGB color space, combining the three layers into a single image. For encoding, you work in the CMYK color space to ensure that colors are represented correctly when printing the QR code. Decoding is performed in the RGB color space, using advanced algorithms to separate the different color layers and extract the encoded information. Image processing techniques such as segmentation and thresholding are used to identify and process the color modules in the QR code. This involves analyzing entire modules rather than individual pixels, ensuring better decoding accuracy. Specific algorithms are developed for the decoding of QRGB codes, which can identify and separate the color layers. These algorithms must be able to handle color variations caused by printing and other environmental factors. It ensures that QRGB codes are compatible with current scanning devices, allowing them to read and decode the data stored in the color codes. QRGB codes are tested in various applications, such as document security, digital business cards, and interactive advertising, to validate their effectiveness and security. Continuous evaluation is carried out to improve the methodology and ensure that the codes are robust and reliable in different scenarios.
Development in Repli.it Python programming language.
Replit.itis an online platform that allows users to write, run, and collaborate on code in various programming languages, including Python. It is especially useful for learning to program, making rapid prototypes, and collaborating on projects easily.
Replit.it Python features are:
-IDE in the Cloud: You don't need to install anything on your computer. You can code from anywhere with Internet access.
-Collaboration: Allows multiple users to work on the same project in real time.
-Support for Multiple Languages: In addition to Python, it supports many other languages such as JavaScript, Ruby, HTML/CSS, among others.
-Packages and Libraries: You can easily install libraries using the terminal, such as pip for Python.
-Simple Deployment: You can create web applications and easily share them with others.
Enter Replit through the mentioned link, there you must log in with your Gmail account. Once inside, you will be able to select from several simulations, programs or online programming environments (select Python).
Shell libraries that you will need to install in Repli.it Python:
You will first need to install the Python libraries.To use these libraries open your Replit.it Python project (main.py) and go to the tab(in the left panel), find and click the “Shell” tab (to the right of “Console”).
-pip install qrcode[pil]: This command installs the qrcode library, which is used to generate QR codes. The [pil] option indicates that the Pillow dependency must also be installed, which is an image manipulation library required to work with images generated by qrcode.
-pip install pillow: This command installs Pillow, a Python library for opening, manipulating, and saving different image formats. It is very useful for working with images in projects that involve graphics or visualization.
-pip install opencv-python: This command installs OpenCV, a powerful library for computer vision. It is used to perform tasks such as image processing and object detection. It is very versatile and widely used in image analysis projects.
Program to create QRGB Codes (overlapping) in Repli.it Python.
Figure 14.
Own development of the QRGB encoding code in Python.
Figure 14.
Own development of the QRGB encoding code in Python.
The information contained in this image can be copied and pasted (copy paste) to Repli.i and Python (to encode QRGB Codes):…
from PIL import Image
# Feature to create a QR code of a specific color
def create_qr(data, color, back_color="white"):
qr = qrcode.QRCode(version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4)
qr.add_data(data)
qr.make(fit=True)
img = qr.make_image(fill_color=color, back_color=back_color).convert("RGBA")
return img
# Ask the user for information
data1 = input("Enter the information for the first QR code (Red): ")
data2 = input("Enter the information for the second QR code (Green): ")
data3 = input("Enter the information for the third QR code (Blue): ")
# Create QR codes with white background
qr_red = create_qr(data1, "red")
qr_green = create_qr(data2, "green")
qr_blue = create_qr(data3, "blue")
# Save individual QR codes
qr_red.save("qr_red.png")
qr_green.save("qr_green.png")
qr_blue.save("qr_blue.png")
# Create a black image for the background
size = qr_red.size
final_image = Image.new("RGBA", size, "black")
# Get QR code data
data_red = qr_red.getdata()
data_green = qr_green.getdata()
data_blue = qr_blue.getdata()
# Create the final image pixel by pixel
new_data = []
for i in range(len(data_red)):
r1, g1, b1, a1 = data_red[i]
red_pixel = (r1, g1, b1) != (255, 255, 255) # True if the pixel is not white
r2, g2, b2, a2 = data_green[i]
green_pixel = (r2, g2, b2) != (255, 255, 255) # True if the pixel is not white
r3, g3, b3, a3 = data_blue[i]
blue_pixel = (r3, g3, b3) != (255, 255, 255) # True if the pixel is not white
if red_pixel and green_pixel and blue_pixel:
new_data.append((255, 255, 255, 255)) # White
elif red_pixel and green_pixel:
new_data.append((255, 255, 0, 255)) # Yellow
elif red_pixel and blue_pixel:
new_data.append((255, 0, 255, 255)) # Magenta
elif green_pixel and blue_pixel:
new_data.append((0, 255, 255, 255)) # Cyan
elif red_pixel:
new_data.append((255, 0, 0, 255)) # Red
elif green_pixel:
new_data.append((0, 255, 0, 255)) # Green
elif blue_pixel:
new_data.append((0, 0, 255, 255)) # Blue
else:
new_data.append((0, 0, 0, 255)) # Black
final_image.putdata(new_data)
# Save the final image
final_image.save("superposed_qr.png")
final_image.show()
Figure 15.
and 16.Own development of the QRGB encoding code in Python and its execution (Run).
Figure 15.
and 16.Own development of the QRGB encoding code in Python and its execution (Run).
Figure 17.
After giving Run the execution of the Python code. The requested data is entered. Source: Own development of the QRGB encoding code in Python.
Figure 17.
After giving Run the execution of the Python code. The requested data is entered. Source: Own development of the QRGB encoding code in Python.
Indeed, after running (Run) in the Console, the questions (imput) will appear to enter the information of the first, second and third QR code, which in these cases are my Google Scholar, Researchgate and Academia.edu profiles respectively.
Figure 18.
EThe Python code generates the intermediate step of three (3) QR Codes in RGB colors (Red, Green and Blue) in image format (.png), with the data entered in “Console”. Source: Own development of the QRGB encoding code in Python.
Figure 18.
EThe Python code generates the intermediate step of three (3) QR Codes in RGB colors (Red, Green and Blue) in image format (.png), with the data entered in “Console”. Source: Own development of the QRGB encoding code in Python.
Figure 19.
With the intermediate step of three (3) QR Codes in RGB colors (Red, Green and Blue) in image format (.png), the pixels to generate the modules are processed (the pixels to generate the modules) of the final QRGB code. Source: self made.
Figure 19.
With the intermediate step of three (3) QR Codes in RGB colors (Red, Green and Blue) in image format (.png), the pixels to generate the modules are processed (the pixels to generate the modules) of the final QRGB code. Source: self made.
Figure 20.
QRGB code generated in image format (.png). Source: self made.
Figure 20.
QRGB code generated in image format (.png). Source: self made.
Program to read QRGB Codes (overlaid) in Repli.it Python.
Figure 21.
Own development of the QRGB decoding code in Python.
Figure 21.
Own development of the QRGB decoding code in Python.
The information contained in this image can be copied and pasted (copy paste) to Repli.i and Python (to decode QRGB codes):…
import cv2
from PIL import Image
# Feature to read a QR code from an image
def read_qr(filename):
img = cv2.imread(filename)
detector = cv2.QRCodeDetector()
data, vertices_array, _ = detector.detectAndDecode(img)
if vertices_array is not None:
return data
else:
return None
# Feature to decode the overlay QR manually
def manual_decode_superposed_qr(filename):
superposed_img = Image.open(filename)
superposed_data = superposed_img.getdata()
size = superposed_img.size
red_data = [(255, 255, 255, 255)] * len(superposed_data)
green_data = [(255, 255, 255, 255)] * len(superposed_data)
blue_data = [(255, 255, 255, 255)] * len(superposed_data)
for i in range(len(superposed_data)):
r, g, b, a = superposed_data[i]
if r != 0: # Red
red_data[i] = (0, 0, 0, 255)
if g != 0: # Green
green_data[i] = (0, 0, 0, 255)
if b != 0: # Blue
blue_data[i] = (0, 0, 0, 255)
red_img = Image.new("RGBA", size)
green_img = Image.new("RGBA", size)
blue_img = Image.new("RGBA", size)
red_img.putdata(red_data)
green_img.putdata(green_data)
blue_img.putdata(blue_data)
red_img.save("decoded_red.png")
green_img.save("decoded_green.png")
blue_img.save("decoded_blue.png")
data_red = read_qr("decoded_red.png")
data_green = read_qr("decoded_green.png")
data_blue = read_qr("decoded_blue.png")
return data_red, data_green, data_blue
# Read the overlaid QR codes manually
data_red, data_green, data_blue = manual_decode_superposed_qr("superposed_qr.png")
print("Decoded information:")
print(f"Red: {data_red}")
print(f"Green: {data_green}")
print(f"Blue: {data_blue}")
Figure 22.
EThe Python code generates the intermediate step of decoding the three (3) QR Codes in RGB colors (Red, Green and Blue) in image format (.png), with the data entered in “Console”. Source: Own development of the QRGB encoding code in Python.
Figure 22.
EThe Python code generates the intermediate step of decoding the three (3) QR Codes in RGB colors (Red, Green and Blue) in image format (.png), with the data entered in “Console”. Source: Own development of the QRGB encoding code in Python.
Figure 23.
EThe Python code generates the response in the “Console” after running the Repli.it Python decoding code and the information previously loaded with the data appears. Source: self made.
Figure 23.
EThe Python code generates the response in the “Console” after running the Repli.it Python decoding code and the information previously loaded with the data appears. Source: self made.