WEBVTT

00:00:00.319 --> 00:00:03.840
hi in this video we'll be talking about

00:00:03.840 --> 00:00:07.740
how computers encode images so here's a

00:00:07.740 --> 00:00:10.260
question how exactly our image is stored

00:00:10.260 --> 00:00:12.990
and displayed on computers we know that

00:00:12.990 --> 00:00:14.460
at the base of it computers are only

00:00:14.460 --> 00:00:16.230
storing zeros and ones it's not like we

00:00:16.230 --> 00:00:18.210
can really take an imprint of that image

00:00:18.210 --> 00:00:19.949
and burn it onto a CD we need a way to

00:00:19.949 --> 00:00:22.080
represent an image as only zeros and

00:00:22.080 --> 00:00:25.140
ones so really we just need a system of

00:00:25.140 --> 00:00:26.939
breaking down an image into concrete

00:00:26.939 --> 00:00:29.250
values that can be stored we know we can

00:00:29.250 --> 00:00:30.630
store numbers with binaries so that's

00:00:30.630 --> 00:00:31.800
that's really what we need to do is find

00:00:31.800 --> 00:00:33.540
a system for turning an image into a

00:00:33.540 --> 00:00:35.430
sequence of numbers we need a digital

00:00:35.430 --> 00:00:38.790
representation of an image so how are we

00:00:38.790 --> 00:00:42.149
going to do that well introducing pixels

00:00:42.149 --> 00:00:44.250
pixels are the building blocks of

00:00:44.250 --> 00:00:46.350
digital images a pixel is the smallest

00:00:46.350 --> 00:00:48.480
element of a digital image it is like

00:00:48.480 --> 00:00:52.079
the atom of a digital image so if you

00:00:52.079 --> 00:00:54.300
look at any image on a computer and you

00:00:54.300 --> 00:00:56.910
zoom in really close we end up seeing is

00:00:56.910 --> 00:00:57.960
that there's actually all these tiny

00:00:57.960 --> 00:00:59.520
squares each of which have their own

00:00:59.520 --> 00:01:01.770
color from a distance everything looks

00:01:01.770 --> 00:01:03.449
like smooth lines you can have gradients

00:01:03.449 --> 00:01:05.670
you can have depth you can have shadows

00:01:05.670 --> 00:01:07.710
but when you zoom in really close it

00:01:07.710 --> 00:01:09.869
really just boils down to tiny tiny

00:01:09.869 --> 00:01:11.970
squares each of which have their own

00:01:11.970 --> 00:01:15.540
color so we see that an image can really

00:01:15.540 --> 00:01:17.640
be represented as a grid of values where

00:01:17.640 --> 00:01:19.920
each value encodes the color for that

00:01:19.920 --> 00:01:21.900
position there's a grid of pixels and

00:01:21.900 --> 00:01:24.420
each pixel has a constant color so

00:01:24.420 --> 00:01:26.100
really we just need an encoding system

00:01:26.100 --> 00:01:28.409
where each color can map to a particular

00:01:28.409 --> 00:01:31.049
value so what's what's an encoding

00:01:31.049 --> 00:01:32.850
system we can use what's a what's a good

00:01:32.850 --> 00:01:35.869
table that will map values to colors

00:01:35.869 --> 00:01:39.390
well simplest system would just be zero

00:01:39.390 --> 00:01:41.790
being black and one being white the zero

00:01:41.790 --> 00:01:43.619
is off there's no light and the one

00:01:43.619 --> 00:01:45.119
would be a white because there is light

00:01:45.119 --> 00:01:47.340
just using this we can make several

00:01:47.340 --> 00:01:49.560
pixelated images of black and white we

00:01:49.560 --> 00:01:51.119
can add complication to the system later

00:01:51.119 --> 00:01:53.159
but for now let's just practice making

00:01:53.159 --> 00:01:55.380
images using only zeros and ones black

00:01:55.380 --> 00:01:57.810
and white images let's explore this in

00:01:57.810 --> 00:02:00.000
the editor so welcome to the bit

00:02:00.000 --> 00:02:02.369
interpreter tool we see that this time

00:02:02.369 --> 00:02:04.290
the bits are being interpreted as colors

00:02:04.290 --> 00:02:06.659
rather than text what's interesting is

00:02:06.659 --> 00:02:08.069
the bits are the same we're always using

00:02:08.069 --> 00:02:09.929
zeros and ones it's just a matter of

00:02:09.929 --> 00:02:11.130
this software it's a

00:02:11.130 --> 00:02:12.870
of whatever program is interpreting

00:02:12.870 --> 00:02:15.180
these bits that determines the actual

00:02:15.180 --> 00:02:17.330
results what is displayed on the screen

00:02:17.330 --> 00:02:20.400
so here we see the encoding table says

00:02:20.400 --> 00:02:22.530
that zero results in a black pixel and a

00:02:22.530 --> 00:02:24.750
one result in a white pixel again we can

00:02:24.750 --> 00:02:26.280
view the raw format it's all in one line

00:02:26.280 --> 00:02:28.620
or it can go pretty and we can see each

00:02:28.620 --> 00:02:30.540
row here represents a full row in the

00:02:30.540 --> 00:02:32.970
resulting image so if we see if we just

00:02:32.970 --> 00:02:34.770
type a zero that's a black and a one is

00:02:34.770 --> 00:02:36.090
a weight and we can make full images

00:02:36.090 --> 00:02:39.960
like this so I want to add one more

00:02:39.960 --> 00:02:41.600
layer on the bottom just to make

00:02:41.600 --> 00:02:45.090
computer nice and stable we see we've

00:02:45.090 --> 00:02:46.440
made the coda chest logo using only

00:02:46.440 --> 00:02:49.200
black and white pixels so this is one

00:02:49.200 --> 00:02:52.400
way we can make black and white images
