0% found this document useful (0 votes)
262 views

Data Compression and Encoding Using Colors

This document discusses using colors to represent and compress data. It begins by explaining color perception and the RGB color model used in digital devices. Data can be represented by assigning each color in the RGB color cube a unique number based on its red, green, and blue values. A color sensor can detect the red, green, and blue values of colors and translate them into numeric representations that computers can process. This allows compressing large amounts of data into colored cells that can be scanned and decoded back into the original information.

Uploaded by

ARVIND
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
262 views

Data Compression and Encoding Using Colors

This document discusses using colors to represent and compress data. It begins by explaining color perception and the RGB color model used in digital devices. Data can be represented by assigning each color in the RGB color cube a unique number based on its red, green, and blue values. A color sensor can detect the red, green, and blue values of colors and translate them into numeric representations that computers can process. This allows compressing large amounts of data into colored cells that can be scanned and decoded back into the original information.

Uploaded by

ARVIND
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 10

DATA COMPRESSION AND ENCODING USING COLORS

(A NEW APPROACH FOR CODING)


Abstract: Introduction:

The coding formats available today like Color is the result of interaction between

the barcodes have proved to be a light source, an object and an observer.

successful because of their various In case of reflected light, the light falling

applications like coding of products by a on an object will be reflected or

manufacturer, coding of books by a absorbed depending on the surface

publisher, etc. The continuous characteristics such as reflectance and

advancement in the sensors technology transmittance. For example, red paper

can provide advancement in the coding will absorb most of the greenish and

format. The improvement in color sensors bluish part of the spectrum while

technology can give rise to a better and reflecting the reddish part, making it

efficient coding technique. One such appear red to the observer.

method “color cells technology” is


proposed and described in this thesis.

Any color is the combination of three


Due to its advantages like the primary colors Red, Green and Blue in
compactness, security, and efficiency, fixed quantities. A color is stored in a
this code is well suited to be used as a computer in form of three numbers
substitute for all available codes like the representing the quantities of Red, Green
barcode. and Blue respectively. This
representation is called RGB

In this paper, we provide some insight representation which is used in

into color perception, measurement, computers to store images in BMP, JPEG

specification, and look at couple of ways and PDF formats. Here each pixel is

on how data can be produced by a color represented as values for Red, Green and

sensor. Then we study the designing of Blue.

the color cells encoding technology and


its decoding using color sensor and a
method to compress data using colors. Thus any color can be uniquely
represented in the three dimensional
RGB cube as values of Red, Green and
Blue.
_ _
54
model is that these colors may be written in several
different ways.
RGB color cube:

Numeric representations:

Color science talks about colors in the range


0.0 (minimum) to 1.0(maximum). Most color
The RGB color model is an additive
formulae take these values. For instance, full
model in which Red, Green and Blue
intensity red is (1.0, 0.0, 0.0).
are combined in various ways to
produce other colors. By using
The color values may be written as
appropriate combination of Red,
percentages, from 0% (minimum) to100%
Green and Blue intensities, many
(maximum). Full intensity red is 100%, 0%,
colors can be represented.
0%.
Typically, 24 bits are used to store a
color pixel. This is usually
The color values may be written as numbers in
apportioned with 8 bits each for red,
the range 0 to 255, simply by multiplying the
green and blue, giving a range of
range 0.0 to 1.0 by 255. This is commonly
256 possible values, or intensities,
found in computer science, where
for each hue. With this system, 16
3 24 programmers have found it convenient to
777 216 (256 or 2 ) discrete
store each color value in one 8-bit byte. This
combinations of hue and intensity
convention has become so widespread that
can be specified.
many writers now consider the range 0 to
A color in the RGB color model can
be described by indicating how 255 authoritative and do not give a context
much of each of the red, green and for their values. Full intensity red is (255, 0,
blue color is included. Each can vary
between the minimum (no color) 0).
and maximum (full intensity). If all
the colors are at minimum the result _ The same range of 0 to 255 can be written
is black. If all the colors at
maximum, the result is white. A in hexadecimal too with prefix #. For
confusing aspect of the RGB color example Red is (#ff,#00, #00).
Color sensor circuit and operation:
Thus we get three output voltage levels for a single
color. Each output depends on the intensity or hue of
respective color. The maximum possible output
voltage is given the value 255 on scale and the whole
length is divided into 256 equal parts (pixel length).
Though output is analog, we are considering it as
digital i.e. step function of a value is considered. For
example, the range of 123.01 to 123.99 is considered
as

A light to analog-voltage-color 123. Thus, the output of our sensor is exactly


sensor comprises an array of computer representation and can be directly fed
photodiodes behind color filters and into computer using interfacing circuits
an integrated current-to- voltage (multiplier).
conversion circuit (usually a
transimpedence amplifier). Light Color sensing:
falling on each of the photodiodes is
converted into a photocurrent, the
magnitude of which is dependent
on both the brightness wavelength
(wavelength due to the color filter)
of the incident light. The red, green
and blue transmissive color filters
will reshape and optimize the
photodiode’s spectral response.
Properly designed filters will result A light source and an object are kept very near to

in a spectral response for the each other. Light reflects on the object and falls on

filtered photodiode array that the sensor’s lenses. Then sensor operation takes

mimics that of the human eye. The place and three output voltages are obtained for

photocurrents from each of the Red, Blue and Green respectively.

three photodiodes are converted to


VRout, VGout, VBout using a
current-to-voltage converter.

_ _
56

Data representation using 256 * 256 = 16777216 different colors can


colors: distinguished. If we represent each color with a
In computers, we generally use number, then we’ll have 16777216 numbers.
256 color mode for displaying
colors. Hence each coordinate Example:

axis R,G,B are divided into 256


parts each. Resolution used is Res
= 256.

For giving numbers to cells in the


cube, we start from Red axis, then
Green and then Blue. When a color
is represented in (red, green, blue)
format where red, green and blue
correspond to the coordinate axis
of a particular color, its
corresponding number is given by
This is a low resolution ( Res = 16) RGB color cube
in Red and Green axes. As defined earlier, each cell
represents a different number starting from origin
N = (red) + (Res * green) + (Res *
Res * as 0. After completing two dimensions, third
blue) dimension can be taken for more numbers.

Thus each color can be uniquely Color fading:


represented by a number
depending on the resolution. A Color fading can be a major drawback of this

simple C program can do this technology. Because of color fading, data may be

conversion. Higher the resolution, represented wrongly. Color generally fades with

more the numbers can be time. Disadvantages due to fading can be

represented using colors. minimized by selecting the resolution such that


cell size is larger than maximum possible fading.
As the technology and precision of devices
Using RGB 256 color mode, 256
increases, resolution can be increased but the
different shades of each color are
concept is same.
uniquely represented in a
computer. Therefore 256 *
BARCODE READER
Bar coder readers decodes a bar Advantages:
code by scanning across the bar
There are two basic advantages to barcode over
code and measuring the intensity of
manual data entry: Speed, and Accuracy. For 12
the light reflected back. The light
characters of data, keyboard entry takes 6 seconds.
variation is converted into digital
Scanning a
signal. Due to barcode design, it
does not matter we scan from the 12 character barcode takes 0.3 seconds. The error

left to right or from the right to rate for typing is one substitution error in every 300

left. characters types. Error rated for barcode range from


1 substitution error in every 15,000 to 36 trillion
characters scanned (depending on the type

of barcode). Data is coded easily using some coding


softwares before printing barcode label and decoded
using corresponding decoding software. Thus
barcode represented data is secured.

A barcode reader contains two


parts. The first part is the scanner Disadvantages:
that scans the image and coverts
into digital representation The size of barcode label depends on the maximum
(01111000). It consists of a photo- number it can represent. As the number increases,
resist size of barcode increases. Generally maximum
number used is 9999. Barcode reader cannot scan
(resistance depends on intensity of
properly if the label is crumpled or distorted
light) and a current to voltage
converter. Output of the barcode (this usually happens while transportation) or label
reader depends on the intensity of is tilted while feeding it to reader. Since a single dot
reflected light. The black bars scans the whole label, scanning time increases as
represent 1’s and white spaces its length increases.
represent

0’s.length of bar does is not


significant. The second part is the
decoder which combines the binary Color code versus Barcode:
digital signals into a series of Disadvantages with barcode can be rectified using
characters. The decoded rainbow code. Color code defines more numbers
information is sent to the computer than barcode. A small circle is enough to represent
via keyboard or serial interfaces. any number. Since we won’t be using more than 1
lakh on barcode, we can even represent last two
digits as paisa. E.g. 256 can be
taken as Data security:

2.56, 16777216 as 167772.16 etc.


Even if the label is crumpled, the Data printed using color code can be made secured

color won’t change. Thus data in by using an encoding technique. Key (X, Y, Z) can be

color code is more reliable. The used for encoding purpose. For example, if we have

sensor need not be placed to print a color representing (R, G, B), then instead of

horizontally. It can be focused on printing that color (R+X, G+Y, B+Z) can be printed.

the circle from any angle. Data X, Y, Z values can be positive or negative integers.

scanning time is also less because The person who knows the key can move back and

only a small dot needs to be sensed get to the original cell. Thus the data printed using

and output voltages will be available color code technology is highly reliable and secured.

in no time (propagation delay from Confidential data can be transmitted using this

input to output is very less). Since “Key” concept.

we are already representing colors


Data Encoding and Compression using
using 256 color mode in a
ASCII:
computer, data can be fed into
computer very easily. An ordinary
American Standard Code for Information
inkjet printer can print all these
Interchange (ASCII) is a character encoding based
colors.
on the English alphabet. ASCII codes represent text
in computers, communications equipment, and
Barcodes are being used widely
other devices that work with text. Using ASCII,
because they have many
advantages and very few 128 characters are encoded. Each character is
disadvantages. If we can rectify represented by 7 bits.
those few disadvantages using
color codes, they will easily
replace barcodes in all
applications.
Data encoding:

In RGB 256 color mode,pixel is represented by 24 bits, in which 8 bits represent the
intensity of each color. For example, a color (80, 121, 150) is represented as
(01010000 011110010010110). In our model, we divide this cube into 8 parts.
Sequences starting with (0bbbbbbb bbbbbbb 0bbbbbbb) where b stands for binary bit 1
or 0 come under first cube.

Bit sequence no
(0bbbbbbb 0bbbbbbb 0bbbbbbb) 1
(0bbbbbbb 0bbbbbbb 1bbbbbbb) 2
(0bbbbbbb 1bbbbbbb 0bbbbbbb) 3
(0bbbbbbb 1bbbbbbb 1bbbbbbb) 4
(1bbbbbbb 0bbbbbbb 0bbbbbbb) 5
(1bbbbbbb 0bbbbbbb 1bbbbbbb) 6
(1bbbbbbb 1bbbbbbb 0bbbbbbb) 7
(1bbbbbbb 1bbbbbbb 1bbbbbbb) 8

We use first sub cube (1) to define all the characters in ASCII table. The first 128 parts of
each color are used to denote a character in the ASCII t able. For convenience, we use
the same order. Since a color is defined by three coordinates, thre e different characters
can be defined by using a color. The Red value defines the first character, Green value
defines the second character and Blue value defines third character.

By using this scheme, an MS-worddocument can be converted to a bitmap image. Every


three characters will be denoted by a pixel of corresponding color.To achieve data
encoding for transmitting secured and confidential data, the following methods can be
used.
_ We can shuffle the order and maintain a database of shuffled order. Three
different databases can be maintained for Red, Green and Blue for more security. Thus
characters are shuffled before transmission and after reception; the receiver can
retrieve original data by using same set of databases.
_ We can use a key as defined earlier and send different colors representing the
data. The receiver can recover the original data only if he knows the key.

Data compression:
In the above approach, we are not using all the colors efficiently. By using the remaining
colors in the other 7 coordinates, we can use the whole cube very efficiently and even
data compression can be achieved.

The remaining seven sub cubes contain 256 * 256 * 1 56 * 7/8 = 14680064 colors.
There are nearly 10000000 English words and templates used in MS word (Including all
fonts and formats). We can make a database where each color (from these remaining
seven sub cubes) represents a word. Then any word which has more than 3 letters ( or
characters) can be defined by a color which requires three 8 bit numbers to be
represented. The words which are not in the dictionary (names, places etc) are not
compressed and are represented by colors in first quadrant.
Thus by using a database, any word, no matter how many characters it has, can be
represented by a color which requires only 24 bits to be represented. Thus data can be
compressed to a large extent.

By using the above concepts of encoding and compression, large amounts can be
compressed and transmitted in a more secured way. Even if the data is hacked by
unauthorized person, he cannot decode it unless he has the same database an d knows
the key.

Using the concept of compression, more amounts of data (word documents) can be
printed in very less space (as images). Printing data is very easy because an ordinary
printer can print all the 256 mode colors. It prints colors by mixing magenta, cyan and
yellow in subtractive color mixing. Cyan, Magenta and Yellow are opposite to Re d,
Green and Blue in the RGB cube. A printer uses CMY subtractive mixing because white
paper is used for taking printouts and ink need ot be wasted to print white.

Conclusion:

Color sensors have a wide range of applications. They can completely replace barcode readers. Using
colors, large amount of data can be printed on small space and can be retrieved back effectively. Data
entry into computer is very easy because same RGB concept is already used there. They are the future
because there is no limitation number of colors and as technology advances, more number of colors can
be defined more precisely from the same RGB cube. Data transferred by using colors is more secured.
Data compression is done by maintaining a data base and sending templates which represent the word.
Thus data compression using this technology is more efficient and error free.

References:
1.http://www.keyence.com/products/sensors

2. http://en.wikipedia.org/wiki/ASCII
3. http://en.wikipedia.org/wiki/RGB_color_model

4http://www.taltech.com/TALtech_web/resources/intro_to_bc/bcpwork.htm

You might also like