AP Computer Science Principles DAT-1 Faculty Lecture on Data Representation
Summary
TLDRProfessor Paul Tiemman from Rochester Institute of Technology explains how data is internally represented in computers, focusing on binary and decimal number systems. He covers converting binary to decimal and vice versa, emphasizing positional numbering systems and powers of two. The presentation also explores the RGB color model and delves into steganography, demonstrating how to hide messages within digital images by manipulating pixel bits. Tiemman shows that even with significant bit reduction, images can still convey their original content, highlighting the power of digital manipulation and the importance of skepticism when interpreting digital media.
Takeaways
- π Professor Paul Tiemman from Rochester Institute of Technology introduces the concept of data representation in computers, focusing on binary and decimal systems.
- π The positional numbering system is explained, emphasizing that each digit in a binary number represents a power of 2, which is key to converting binary to decimal.
- π A methodical approach to converting binary to decimal is demonstrated using a chart to identify and sum the relevant powers of 2.
- π An important check is highlighted for binary to decimal conversion: if the binary number ends in 0, the decimal result must be even, ensuring conversion accuracy.
- π The reverse process of converting decimal to binary is explained, using a similar chart method but starting with powers of 2 greater than the decimal number.
- π‘ The significance of the least significant bit (LSB) in determining the parity (odd or even) of a decimal number when converting from binary is discussed.
- πΌοΈ The concept of image representation in computers using pixels and the RGB color model is introduced, showing how colors are created by combining red, green, and blue intensities.
- π¨ The potential for steganography in digital images is explored, demonstrating how messages can be hidden by manipulating pixel data without noticeably altering the image.
- π A practical example of steganography is given, where the entire text of 'Alice in Wonderland' is encoded within the least significant bits of a digital image's pixels.
- π€ The presentation concludes with a binary joke, emphasizing the importance of understanding binary for computer scientists and highlighting the manipulability of digital data.
Q & A
What is the main topic of Paul Tiemman's presentation?
-The main topic of Paul Tiemman's presentation is how data, including numbers, images, and text, is represented internally in a computer using binary numbers.
How does positional numbering system work in the context of binary numbers?
-In a positional numbering system, each position in a number represents a particular power of the base of the number. In binary, each bit represents a different power of 2, starting from 2^0 on the right and increasing as you move left.
What is the process for converting a binary number to a decimal number?
-To convert a binary number to a decimal, you determine which powers of 2 are represented by the 1s in the binary number and sum those powers. For example, the binary number 1 1 0 0 1 0 1 0 1 0 is converted to decimal by summing 512 + 256 + 32 + 8 + 2, which equals 810.
How can you check if a binary number represents an even or odd decimal number?
-If a binary number represents an odd decimal number, the least significant bit (rightmost bit) must be 1. If it's 0, the number is even. This is because all powers of 2, except 2^0, are even.
What is the method for converting a decimal number to a binary number?
-To convert a decimal number to binary, you determine which powers of 2 can be subtracted from the number until you reach zero, marking a 1 for each power of 2 used. For example, to convert 453 to binary, you would start with the highest power of 2 less than 453 (which is 256), mark a 1, subtract 256 from 453, and continue this process for the remaining number.
How many unique values can be represented with an 8-bit number?
-With an 8-bit number, you can represent 256 unique values, calculated by raising 2 to the power of the number of bits (2^8).
What is the RGB color model and how is it used in computing?
-The RGB color model is an additive color model where red (R), green (G), and blue (B) intensities are combined to create various colors. In computing, images are represented by pixels, each with an RGB value, allowing for a wide range of colors to be displayed.
What is steganography and how can it be applied to digital images?
-Steganography is the practice of hiding a message within another message or object. In the context of digital images, it involves modifying some of the bits in an image's pixels to encode a hidden message without significantly altering the image's appearance.
How does the presenter demonstrate the encoding of a message in a digital image?
-The presenter demonstrates encoding a message by using the least significant bit of the red channel in each pixel to store bits of an ASCII character. The entire text of 'Alice in Wonderland' is encoded in the pixels of an image, with only about half of the pixels being changed, making the alteration nearly imperceptible.
What is the significance of the joke 'There are 10 types of people in the world' mentioned in the presentation?
-The joke 'There are 10 types of people in the world: those who understand binary, and those who don't' is a play on the fact that binary is a base-2 number system, which only has two digits, 0 and 1. It humorously implies that there are only two kinds of people: those who can think in binary and those who cannot.
Outlines
π‘ Introduction to Data Representation
Professor Paul Tiemman introduces the topic of data representation in computers, specifically focusing on the conversion between binary and decimal systems. He emphasizes the importance of understanding positional numbering systems, where each position in a number represents a power of the base. In binary, each bit represents a power of 2, and conversion to decimal involves summing the relevant powers of 2. A chart is used to illustrate this process, showing how to determine which powers of 2 to add together based on the binary digits. The professor also discusses a simple check for binary to decimal conversion, noting that the least significant bit must be 1 for odd numbers and 0 for even numbers.
π’ Decimal to Binary Conversion
The script continues with the process of converting decimal numbers to binary. A table is used to determine which powers of 2 are needed to sum up to the decimal number. The professor explains that powers of 2 greater than the decimal number are not included. The conversion process involves subtracting each power of 2 that can be included in the sum from the decimal number, moving right to left across the table. The example given is converting the decimal number 453 to binary, resulting in 111000101. The professor also discusses the range of numbers that can be represented with a given number of bits, explaining that 2 to the power of the number of bits gives the total number of unique values that can be represented.
πΌοΈ Digital Image Representation
The third paragraph delves into how images are represented in a computer, using the RGB color model where colors are created by combining red, green, and blue intensities. The professor explains that images are divided into pixels, each with a unique color determined by RGB values. The example of Grumpy Cat is used to illustrate how images are broken down into pixels. The concept of steganography is introduced as a way to hide messages within images or other objects. The paragraph concludes with a discussion on the potential for hiding messages within digital images by manipulating bits, suggesting that not all bits are necessary for image representation and some can be used to encode hidden messages.
π Exploring Bit Manipulation in Images
This section explores the impact of bit manipulation on image quality. The professor demonstrates how turning off the least significant bits in the color channels of an image can reduce the number of colors represented without significantly altering the image's appearance. By turning off bits in the image of a samurai, the professor shows that even with fewer colors, the image remains recognizable. This experiment leads to a discussion about the feasibility of steganography in images, where messages can be hidden by modifying certain bits without noticeably changing the image.
π Encoding a Message in an Image
The professor describes a method for encoding a message into an image using ASCII values. By using the least significant bit of the red channel in each pixel, an 8-bit ASCII character can be stored across eight pixels. The example given is encoding the text 'Alice in Wonderland' into an image of Hobbiton. The professor explains that only about half of the pixels need to be changed to embed the message, making it difficult to detect the alteration. The paragraph concludes with a reminder that images on a computer can be easily manipulated and may not always represent reality, and ends with a binary-related joke to emphasize the importance of understanding binary in computer science.
Mindmap
Keywords
π‘Binary Number
π‘Decimal Number
π‘Positional Numbering System
π‘Bit
π‘RGB Model
π‘Pixel
π‘Steganography
π‘ASCII
π‘Project Gutenberg
π‘Manipulation of Digital Media
Highlights
Introduction to data representation in computers, focusing on binary and decimal systems.
Explanation of positional numbering systems and their application in binary.
Conversion of binary numbers to decimal by summing powers of two.
Use of a chart to visualize the conversion process from binary to decimal.
Crossing out powers of two where binary bits are zero for easier conversion.
Self-check method for binary to decimal conversion using the least significant bit.
Conversion of decimal numbers to binary by finding the necessary powers of two.
Creating a table to determine which bits are needed for the decimal to binary conversion.
Determining the range of numbers representable by a given number of bits.
Understanding that 0 is a value and its importance in binary counting.
The concept of steganography and its application in hiding messages.
Hiding a message within a digital image by manipulating pixel bits.
The impact of reducing color depth on image quality and visibility of changes.
Encoding a message using ASCII and the least significant bit of pixel color channels.
The potential to store large texts within images using steganography.
Embedding the entire text of 'Alice in Wonderland' into a digital image.
The importance of critical thinking when interpreting digital images.
Final thoughts on the versatility of binary data manipulation and a parting joke.
Transcripts
hi my name is paul tiemann and i'm a
professor at the rochester institute
technology in rochester new york
and what i want to do today is talk to
you about how
data is represented internally in a
computer
some of this will probably be a review
which i think is probably a good thing
and
hopefully some of it will be new and
you'll learn something interesting along
the way
so the first thing i thought i would do
is just kind of start with some simple
stuff that i'm sure you've seen before
but i want to make sure we're all on the
same page before we get
too far into this and what i want to
just do is go over
converting binary numbers to decimal and
decimal numbers to binary so let's
take looking at a binary number to
decimal first
okay as you probably learned in class
we use numbering systems that are
referred to as positional numbering
systems
and the reason we call them positional
numbering systems is because each
position in the number represents
a particular power of the base of the
number that we're representing here so
in binary each one of the binary digits
or bits
represents a different power of 2. so
what we need to do if we want to convert
a binary number
from binary to decimal what we basically
need to do is figure out what powers of
2 we need to add together
and adding those powers together will
tell us what the number is
now the way i typically do this is i'll
draw myself a little chart
and i'll put the binary number in the
chart so you'll see here in the top row
i've got the number that i want to
convert and in the bottom it's blank at
the moment
and now what i'll do is i'll just simply
fill in
the powers of two that each one of those
bits represents
okay so starting over at the right hand
side we start with one
you're always going to start with one
regardless of the base you're working in
because any number raised to zero is
going to be
one and then since i'm working in binary
as i work my way from right to left what
i just simply do is multiply by two
so you see it's one two four eight
sixteen so on up to five hundred and
twelve
okay so that's the start now the nice
thing about converting
a binary number to decimal is when we
look
at the binary digits there's only two
possibilities there's either gonna be a
one or a zero
and the nice thing is if the bit is a
zero it means that the power is not in
the sum
so what i will also do in my little
chart typically is i will just simply
cross out
any of the values where the bits are
zero okay
and in this particular case that leaves
the powers of 2 512
256 32 8 and 2 and what i do is i add
those together
and i get 810 so i know that the
binary number 1 1 0 0 1
0 1 0 1 0 is equivalent to the decimal
number 810
now another thing that i always like to
do is kind of have a way of checking
myself to make sure that i did things
right
and there's a simple little check that
you can do in
these binary conversions just to kind of
make sure that things are
you know at least you got something
close to the right answer
and what that has to do with is
basically that power of two to the zero
okay uh if you take a look at all the
powers of two with the exception of two
to the zero which is one they're all
even
which means if i am representing an odd
number in binary that
bottom bit or the least significant bit
has to be set to a one
so i can look at that binary number one
one zero zero one zero one zero
one zero without even converting it
because it ends in zero i know it's an
even number
and so what i always do is kind of a
self check is i make it double check
and i say to myself since my binary
number ends in zero
the decimal value that i get as a result
of the conversion must be even as well
okay if it's not if i get an odd decimal
value then i know i did something wrong
i'm going to go back and check my work
okay so that's converting binary to
decimal and i find that really simple to
do
okay now let's take the flip side you're
given a number in decimal and you have
to convert that to binary
all right again i'm going to start it
out basically the same way i'm going to
do my little table
and i want to figure out what powers are
going to be
powers of two i need to add together
here to get 453
so what i've done you'll see in this
case is i filled the powers in the
bottom row
and i've left the top row blank because
i need to figure out
whether the corresponding bit for each
one of those columns is either a zero or
a one
the other thing that i want you to kind
of notice and hopefully
you spotted it right off the top of your
head 453
is an odd number so i know whatever
answer i get here that least significant
bit where
we have two to the zero it has to be a
one and if it's not i did something
wrong when i did the conversion
now another question that you might want
to ask yourself is
how do i know how many powers of 2
how many columns i'm going to put in
this table all right
remember what i'm trying to do here is i
want to figure out the powers of 2 that
i need to add together
to get the number 453
if i have a power of 2 that's greater
than 453 like 512
512 can't possibly be one of the numbers
that i need to add together to get 453
so what i'll do when i'm generating my
table is i'll happily double my numbers
until i hit the first power of two
that's greater than the number that i'm
trying to convert
so that's why i stopped at 512 here
okay and the next thing i'll do is i'll
pop a zero in that column just to remind
myself
that power is not going to be in this
number all right
so now the question is how do i do the
conversion well the way i use the table
and the way that i do the conversion
here
is i'll work my way in this particular
case from left to right
and for each power i'll ask the question
can i subtract that power from the
number i'm trying to convert
so i have 256 256 is less than 453
so i know that the power 256 has to be
in the binary number
that's going to be the equivalent 453
so what i'm going to do is i'm going to
put a 1 above 256 as a reminder that
that's going to be
in the resulting binary number and then
the other thing i'm going to do is i'm
going to take 453 i'm going to subtract
256 from it
because i've accounted for that number
already that leaves me with 197.
and so now as i work my way down the
table and i consider the next column
i'm going to be looking at 197 and not
453
okay and as i work my way across i look
at 128 128 is less than 197
so i'll put a 1 up there and as i did
before i'll compute what the difference
is
working my way down the line i see that
64 is less than 69
so again i'll put a one up there okay
and now i only have five left
the next column is the column that
represents 32
well that can't be in it it's too big
16 can't be in it because it's too big
eight can't be in it because it's too
big
that gets me down to four well four is
going to be in there
so i'll take uh put a one above the four
as you're reminded that that's it that
bit is turned on in this particular
binary representation
i'll subtract four from five i have a
one left
um two is bigger than one so there'll be
a zero there
and lo and behold i have one left so i'm
gonna put a one above
and i've accounted for all the numbers
and so
reading the binary number off the table
i can see that 453 decimal
is equivalent to 1 1 1 0
0 0 1 0 1 in binary
and again what i want you to notice is
we spotted upfront ahead of time
that 453 is an odd number so is
one one one zero zero zero one zero one
because it ends in a one okay so there's
a little bit of confidence that we got
it right
now the other thing that i want to uh
again
just go over real quick and again i
think this is a review but this is going
to be very pertinent to what i'm going
to show you in a minute
is i want to ask the question if i
have a certain number of bits that i'm
going to use to represent a number
what's the range of numbers that i can
represent in that number of bits
okay and what i did here just so that we
have a kind of a
concrete point is how many unique values
can i represent in an
8-bit number but you should be able to
answer this question really for
binary numbers that have an orbit you
know any number of bits
okay so how can we figure this out well
a lot of times what i like to do
is i like to kind of try to walk very
slowly to get to the solution so
what i'll ask myself first here is well
what if i only have one bit how many
unique values can i represent
using one bit well with one bit
i can either represent zero or i can
represent one
and what that means is i have two values
okay what if i jump up to two bits now
well if i jump up to two bits
you can see i now have four values
all right and if you take a look at that
table you'll
kind of notice a pattern if you look in
the left the right hand
column you're going to notice it goes 0
1
0 1 which is exactly the one bit
pattern but it's duplicated twice and
then if you look at the column on the
left hand side you're going to see that
i put a zero
in front of the first repetition from
that
two bit from that one bit table and then
one in front of and that's how you get
four
right what about three bits
okay well here's three bits and again
with three bits you can see that it's
going to be eight unique values and
again
the same pattern applies so doing this
it sort of looks like
we could say well it looks like if you
take
two raise it to the number of bits that
you have
that's going to give you the number of
values at least that applies to these
three cases here
so let's try that out okay let's try it
for four bits
according to that postulation we made on
the previous slide
this should be we should be able to
represent 16 values using four bits
all right well with four bits the
largest number that i can represent
in binary is one one one one and if you
do a quick conversion in your head
you'll realize that that's
15 decimal okay so what that means is in
four bits
i can count one two three
up to 15 using four bits but you might
look at that and say but
that's only 15 values and it seems to
break the rule that you came up with
on the previous slide but we left out
something really important
and this is something that comes up over
and over and over again in computing
you've got to remember that 0 is also a
value that we can represent
so when we look at counting i actually
start counting at
0. and if i start counting at zero and
if i go up to 15
while the maximum value that i can
represent is
15 there are actually 16 unique values
there
so it does work so in general what we
can say
is you take the number of bits you raise
two to that
so using eight bits to answer the
question we had on that very first slide
uh using eight bits i can represent a
total of 256 different values
for n bits i can represent two to the n
different values
okay so like i said that should just be
a review i think it's something that
you've probably seen before
um you may have done it a little bit
differently but sometimes looking at
something in
different perspectives gives you a
little bit more insight into it
okay the big thing i want you to
remember from this
presentation is that if something is in
the computer
it's nothing but this and i don't care
what it is i don't care if it's numbers
that we just looked at
images videos this presentation you're
looking at is inside a computer
it's nothing but bits all right just the
crazy stream
of zeros and ones that's everything
that's inside that universe of the
computer
now at first you might think that
there's rather limiting
but it's actually kind of empowering
because
if we have things that are represented
in bits and they're in the computer
something that a computer is really good
at is manipulating bits
so once it's in digital form once it's
in the computer
once it's represented as a stream of
zeros and ones
it can be very easily manipulated by a
program
and that's basically what i want to talk
about next
so before i get into that again a quick
review
i i'm going to do some image stuff here
and i want to remind you
how images work inside a computer the
first thing we need to do is delve a
little bit because
color science and there's a variety of
different models that color scientists
use to
to understand and represent and model
colors
one that is commonly used in computing
is a model that's called rgb where r
stands for red g
stands for green and b stands for blue
and it's an
additive color model where you create
colors
by adding together different intensities
of those three
basic colors and that little diagram
that i have on the right there
that it's it basically looks like a venn
diagram
is showing you very simply if i don't
vary
the the intensity of the rgb components
you can see that using those three
different colors it's actually
possible to represent a total of seven
different colors you can see
the red the green and the blue and then
you can see the yellow
uh the purple and whatever color that is
with the
odd g and the b plus white in the middle
okay
and i guess theoretically you could say
there's an eighth color in there
which is good for computers because we
love powers of two
the black is also a color that's
represented there as well
okay so how do we represent images
inside a computer
well this is a picture of my very first
cat his name is grumpy cat
and grumpy cat was called grumpy cactus
he was a little bit strange he would
always want to get petted
but as soon as you petted him he would
bite you and it wasn't like a
love bite it was like i'm drawing blood
so that's why we called him grumpy so
this is
obviously a picture of grumpy he's
obviously in the computer
at him but the images and the question
is well
how do we represent this as a stream of
bits
well commonly a very common way of
representing an image is we'll take an
image and we'll divide it up into a
number of different cells
all right so what i've done here is i've
laid a grid over the picture of grumpy
all right basically this is being done
at a much
finer scale in this image in fact the
scale of these squares is so small
that your eyes can't discern them all
right and that's
kind of the magic here each one of those
individual cells is referred to as a
pixel
and each pixel has one unique color
associated with it
and that color is based on
an r a g and a b value all right
now it's a little bit hard to see the
granularity here so what i did is i took
just grumpy's eye and i blew it up
at 800 percent and now you can actually
start to see the pixels
that make up his eye okay and if you
look carefully
you'll see that each one of those pixels
has
its own color associated with it all
right and that's
basically how images are represented
inside a computer
and again i expect it's a bit of a
review
one thing that i want to just note is
that
there are many different schemes that
you can use to do the rgb
or the rgb model namely one of the
things that you can differ is the number
of bits
what i'm going to do here is assume that
we're using eight bits for each of those
color channels
um so we have eight bits for red eight
bits for green and eight bits for blue
and using eight bits for those three
colors we can represent more than
16 million different colors okay
all right now what i wanted to
do is talk about um
a technique called steganography and
steganography it sounds really
complicated
but it's something that's been around
forever and it's the practice of hiding
a message within another message or
within another physical object
okay and if you take a look at that
second sentence there
laura's spending echoed assorted
priorities for accurate skateboard use
you might kind of look at that and say
that's a little bit of a weird sentence
but i guess then it makes sense
but what i've actually done is i've
embedded a message inside of that
and until i tell you how to decode that
message you don't know what it is
but i will tell you if you look at the
second
letter in each of the words in that
sentence
it will give you a hidden message so if
i
what i did here is i just bolded them
and maybe you can see it now
and it's still a little bit noisy but if
i just pull those out
you'll see that the message is apcs
rocks
that's steganography it's been around
forever
and there's lots of classic examples of
it um if this is something of interest
you i strongly encourage you at some
point
google steganography sometime and find
out about it
so why am i bringing this up well what
i'm wondering is
can we hide a message inside of a
digital picture
the answer is going to be yes and so the
question is
how can i go about doing that all right
well
if i want to hide a message inside a
digital picture
what i'm going to have to do is modify
some of the bits in that
picture to encode the message all right
kind of like what i did in the previous
sentence it was a pain to come up with
i had to come up with words that had the
right second letter in it
all right and i need to kind of do the
same thing here i need
to change some of the bits in the
picture
now i've already mentioned that in an
8-bit
rgb image we can in one pixel i can
represent 16 million different colors
so a question might be is
do we really need all 24 of those bits
at what point is a kind of overkill
either our eyes can't tell the
difference you know can our eyes
finally determine the difference between
more than 16 million different colors i
know mine certainly cannot
and another question is well what about
the resolution of the device
that i'm displaying the image on a
typical computer or a cell phone
the resolution is probably not going to
be that good anyway
so even though we have 16 million
different
color possibilities the display itself
may not
actually be able to show them so the
question that i kind of want to ask
is if i take a picture and if i start
mucking around with some of the bits in
the picture
at what point do i notice it so this is
a picture of me
uh when i was in new zealand and i
thought i'd stop
at um this happens to be a samurai at
the same wise genji's house
from the hobbit i'm checking to see if
anybody's home
all right and this is the original
picture that i took with my cell phone
uh the basic model that you're seeing
here is exactly what i described
all right there's uh 24 bits here that
are being used for each pixel
and what i did here is i wrote a program
that took this picture and went through
all the pixel values and turned off
the least significant bit so what i did
here and that's what i'm trying to say
at the top
is the x the first seven bits in every
one of those color channels i left them
alone
but i turned the last one off so now
instead of using 24
bits to represent the color i've cut it
down to 21 bits
and using 21 bits i can still represent
a little bit more than 2 million colors
and i'm going to flip back and forth
here for a minute
but it's pretty hard to tell that i did
anything to that picture
well what about turning off another bit
all right so here i've turned off the
last two bits
and so now i'm down to 18 bits i have
a possibility of 262 different colors
now
all right but again i think as i go back
and forth
you're going to see at least i don't i
don't
notice much of the difference here i've
turned off
the last three bits so now i'm down to
32 000 colors
all right and let's go one step further
let's go to four
and now i've turned off the bottom four
bits
so now you have 496 different colors
that i use
and i think you can finally at least i
can see it for sure
you can start to see some differences in
the picture
and the easiest place to spot them is
look at the shadows on the hobbit door
if you look you the the shadow almost
seems pixelated at this point
and it makes sense if you think about it
because i have
fewer shades of that door color to work
with
and so it's going to be harder to for
the image to make a smooth
transition from the dark color
to the light color from the shadow to
the light
okay and i think i went one step further
to kind of push it out one
little bit more here i've turned off all
the bottom five bits and now you can see
is the
the effect is really noticeable at this
point all right
i find it absolutely kind of remarkable
that even after turning off five bits
in each one of the colored channels in
each one of the pixels in this picture
you can still see the image it's it it's
really kind of remarkable and it shows
you
how much extra information is actually
encoded in those pictures
okay so let's get back to steganography
now so what can i do
well what i want to do is we're computer
people
so what i want to do is i want to encode
my message but i'm going to do it using
ascii
so here's an ascii table standard ascii
table you've probably seen something
like this before
i remember that ascii is just the
character mapping and what it does is it
maps
characters to numbers so if i want to
represent for example a capital a
in the computer i do that with a decimal
number 65
or if i were going to look at in binary
it would be 0 1
0 0 0 0
so what i'm going to do is the way that
i'm going to encode my message
is i'm going to take just the least
significant bit
of the red channel of every single
pixel to store one bit of an eight bit
ascii character
so what i'm going to do is i'm going to
take that 8-bit representation of the
ascii character
and i'm going to store it in eight
different pixels
the most significantly in the first
pixel the next bit will be after that
and so on down the line
okay um the hobbiton picture
is rough it's not roughly it is 13 1383
pixels high by 1945
wide that means there's more than two
and a half million pixels in that image
which means if i'm going to use eight of
these for each ascii character
i can store 350 000
characters in that message using this
scheme that's just using the red channel
i could also use the blue and the greek
channel if i wanted to
so what am i going to stick in there we
you can literally stick any text in
there that you want but what i thought i
would do is pick
something that you might recognize and
something that has some heft to it and
what i did is i searched around
online and there's a website called
project gutenberg
and project gutenberg's been around for
a long long time and what
they actually do is they they were the
first people that i'm aware of that had
ebooks in a way
what they've done is they've taken many
classic
books and they've converted them to text
form
so if you ever want to get the text from
a you know a book
it's got to be a classic book usually
you'll find it on project gutenberg
so i went to project gutenberg and i got
the entire text of the story alex and
alice in wonderland turns out there's
166
657 characters in that text
it'll easily fit in my picture so how am
i going to encode it this is just a
picture of what i was trying to describe
before
i'm showing you the first eight um
our red values in my hobbiton picture
and in the first eight what i want to do
is store the a
which we saw was zero one zero zero
zero zero zero zero one all right and
you can see what i've done
i'm going to put that most significant
bit at the first rgb
then the second bit and the next one and
so on down the line and what i've done
here is i've just shown you
the a and the l and if you look at the
right hand column
that's the modified value that i'm going
to write out for
that r value and you're going to see
that not all of these get
changed and that makes sense because
it's going to be the case that only
about 50 of the time
i'm going to need to actually change one
of these bits which means it's going to
be even
harder for you to observe a change in
the image
from embedding this message inside of it
and so
you know long story short this picture
that you see here
looks a lot like the very first picture
that i showed you
um but you'll just have to take my word
for it
that what i've done here is this met
this particular picture
actually has the entire story alice in
wonderland
encoded in the pixels in the picture in
the case you're curious
um i needed about um
when i take a look at the changes out of
all the changes that i made i only
changed about
half of the pixels in the picture and
again
that just points out the fact it's a
little bit harder to
for your eyes to see so really the
takeaway that i want you to see here
is that a once we have things in a
binary form in the computer we can do
some pretty cool things with it
and b and this is really an important
thing that
i'm sure you will discuss at some point
in your csp class
when you see an image on a computer it
may not necessarily be real
it is very easy to manipulate pictures
make them look like something totally
different from what they actually are
okay and then the last thing i thought i
would leave you with
is a joke well sort of a joke but
this is a nerdy kind of a joke there are
one zero types of people in this world
those who understand binary
and those who don't so now that you're
becoming a computer scientist
you can now appreciate what the shirt
means
okay so with that i hope you've enjoyed
this
presentation i had fun putting it
together
and i hope you learned something good
from it have a great day thanks bye
Browse More Related Video
5.0 / 5 (0 votes)