i. Basically, we won’t notice tiny changes to a
picture, but we can use that info to store text
i. There are various image file types
ii. We’ll just focused on uncompressed images,
using the .bmp format
iii. You can think of these images as a 3d array –
indexed by X, Y, and RGB
1. Note – this is a bit of a simplification of
how they are actually stored, but we can represent them this way.
i. RGB
1. 0-255 for each
i. Won’t show this class
ii. Two static methods – readFile and writeFile
1. Takes a filename, and either reads that file
into a 3d array of ints, or writes to that file from a 3d array of ints
i. If it’s odd, that means that we are currently
encoding a piece of text
ii. If it’s even, that represents the boundary
between characters
i. We’ll use the ASCII representation of a
character.
ii. This is a numeric representation of a
character
iii. http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
iv. So, if we see x odds in a row, that
translates to the ASCII character represented by x
v. We reset our counter when we see an even
value
i. There’s a pretty random distribution of
even/odd red color components in a given picture
ii. So, before we encode anything, we first must
have a ‘blank slate’
1. We can do this by setting every R pixel to an
even value