Return to Video

Instagram's Kevin Systrom explains pixels and how filters work

  • 0:01 - 0:04
    A little BIT about Pixels
  • 0:06 - 0:10
    (camera clicks) Good.
  • 0:10 - 0:14
    I created Instagram with my co-founder
  • 0:14 - 0:19
    Mike, initially we saw the mobile phone as
    an opportunity to create something new. Because
  • 0:19 - 0:23
    for the first time people were carrying around
    a computer in their pocket. And we decided
  • 0:23 - 0:28
    that sharing imagery was probably the biggest
    opportunity for the next five years, and one
  • 0:28 - 0:32
    that we held close to our hearts, something we wanted to spend our time on. It's
  • 0:32 - 0:37
    great to say you have an app or an idea that
    does x, y, or z but unless that solves a real
  • 0:37 - 0:42
    problem for people they're not going to use
    it. And the question is: What problem are
  • 0:42 - 0:47
    you solving? (Piper - Photographer) When people
    first faced the problem of how to show a picture
  • 0:47 - 0:52
    on a screen, they had to come up with a way
    to break the image down into data. In 1957,
  • 0:52 - 0:57
    an early computer engineer named Russell Kirsch
    took a picture of his infant son and scanned
  • 0:57 - 1:01
    it. It was the first digital image, a grainy
    black and white baby picture-- and that's
  • 1:01 - 1:08
    how the pixel was born! Pixels are an interesting
    concept because you can't see them very easily.
  • 1:08 - 1:13
    But actually, if you get a magnifying glass
    and you go up to a screen you actually can
  • 1:13 - 1:18
    see that your screen is made up of tiny dots
    of little light. What's more interesting is
  • 1:18 - 1:22
    that those tiny dots of little light are actually
    multiple tiny dots of little light of different
  • 1:22 - 1:28
    colors. There's red, green, and blue. Pixels
    together, from far away, create an image and
  • 1:28 - 1:33
    upfront they are just little lights that are
    on and off. The combination of those create
  • 1:33 - 1:37
    images and what you see on your screen every
    single day you use your computer. So you'll
  • 1:37 - 1:42
    hear the term resolution a lot, both in computer
    science and manufacturers of devices will
  • 1:42 - 1:48
    talk about it. Resolution is basically the
    dimensions by which you can measure how many
  • 1:48 - 1:53
    pixels are on a screen. So back in the day
    when I was a high school student, it was 640
  • 1:53 - 1:58
    by 480 pixels. And today it's a lot bigger.
    And then there's the question not only of
  • 1:58 - 2:02
    resolution, but also density. For instance,
    on modern smartphones they fit the same number
  • 2:02 - 2:07
    of little lights called pixels but in a denser
    space and that's what allows you to get sharper
  • 2:07 - 2:14
    images. Now, how do you store those values
    of the pixels in a file? What you do is you
  • 2:14 - 2:19
    store red, green, and blue values in little
    triplets, effectively. With different values
  • 2:19 - 2:29
    that each make up a single pixel. The values
    range from 0 to 255. 0 would be very dark,
  • 2:29 - 2:38
    255 would be very bright. Triplets of these
    values together compose a single pixel. An
  • 2:38 - 2:43
    image file, whether it's a jpeg, gif, png,
    etc. contains millions of these RGB (red-green-blue)
  • 2:43 - 2:48
    triplets. So how does a computer store all
    that data? All computing and visual data are
  • 2:48 - 2:53
    represented by bits. A bit has two states:
    it's on or it's off. But instead of on or
  • 2:53 - 3:01
    off, computers use 1 and 0 -- binary! An image
    file is actually just a bunch of 1s and 0s.
  • 3:01 - 3:08
    But why do RGB values go from 0 to 255? Turns
    out that each color channel, RGB, is represented
  • 3:08 - 3:14
    by 8 bits, which together are called a byte.
    If you know the binary number system, you
  • 3:14 - 3:20
    know that the maximum number 8 bits can represent
    is 255. 255 is equal to eight 1s in a row.
  • 3:20 - 3:29
    And the lowest is 0 or eight 0s in a row.
    Therefore, 0 to 255 gives us 256 different
  • 3:29 - 3:36
    intensities per color channel. We can represent
    a pixel of the color turquoise for example,
  • 3:36 - 3:43
    in our traditional decimal based number system
    as 64 (for a little red), 224 (for a lot of
  • 3:43 - 3:54
    green), and 208 (for some blue). But a computer
    would have stored it as 0100 0000 1110 0000
  • 3:54 - 4:03
    1101 0000. We use 24 binary digits to represent
    this one pixel. So rather than binary, digital
  • 4:03 - 4:08
    artists often use the hexadecimal number system
    to represent colors. So we can represent the
  • 4:08 - 4:16
    same color turquoise using only six hexadecimal
    digits: 40 E0 D0. Which is a lot shorter.
  • 4:16 - 4:22
    Let's say you want to modify the colors of
    the image. How do you do that? Basically there
  • 4:22 - 4:26
    are ways of mapping functions where you take
    the input value of the pixel. So you take
  • 4:26 - 4:31
    an input of a red, green, and blue value,
    which represents that color. Then you map
  • 4:31 - 4:37
    it using a function to a new red, green, and
    blue value. Let's say you wanted to make an
  • 4:37 - 4:42
    image darker. One way of doing that is by
    taking the red, green, and blue values that
  • 4:42 - 4:49
    come in and let's just say subtracting a fixed
    constant from each of them, say subtract 50.
  • 4:49 - 4:54
    Obviously you can't go below 0, but you just
    subtract 50 from each of them and that's the
  • 4:54 - 5:02
    output. So the input is R, G, B and the output
    is R-50, G-50, B-50. What you'll see is you've
  • 5:02 - 5:06
    taken an image with a certain brightness,
    and you get out an image with a much darker
  • 5:06 - 5:12
    brightness. What a lot of people don't realize
    about Instagram is that initially people thought
  • 5:12 - 5:17
    what it was was a way of filtering images,
    making your images look cool in some way or
  • 5:17 - 5:22
    retro. And what it grew into was actually
    much more important, it was a way of people
  • 5:22 - 5:27
    connecting. It's not just about seeing photos
    of your friends and your family, but actually
  • 5:27 - 5:32
    being able to discover things happening all
    around the world. Whether that's a riot overseas,
  • 5:32 - 5:38
    a social movement, you're able to basically
    consume that information in a visual way.
  • 5:38 - 5:41
    And that allowed us to grow very quickly and
    be a universal platform.
  • 5:43 - 5:49
    Learn more at studio.code.org.
Title:
Instagram's Kevin Systrom explains pixels and how filters work
Description:

Hear Instagram co-founder explain how images are represented in binary, and how image filters work on the inside. This video is part of the Code.org video lecture series for the upcoming Computer Science Principles high school course. For more about the curriculum see http://code.org/educate/csp. For other educational videos from Code.org see http://code.org/educate/videos.

Special thanks to Kevin Systrom and Instagram and Piper Hanson photography http://piperhanson.com

more » « less
Video Language:
English
Duration:
05:50

English subtitles

Revisions