Return to Video

Pythonneries - Making Of 7

  • 0:05 - 0:06
    Hello,
  • 0:06 - 0:09
    I have explained how to manage with
    Gimp, I’m now going to give a
  • 0:09 - 0:14
    number of practical examples. I said it
    at the beginning of this series, whenever I talk
  • 0:14 - 0:18
    about someone, I like to show that someone
    and, to use the example in the previous
  • 0:18 - 0:22
    video, I find it hard to talk about
    the “Pascaline” without showing Blaise Pascal.
  • 0:22 - 0:27
    The mock Internet search of my video on
    shapes, and I get a lot of portraits
  • 0:27 - 0:31
    Pascal. Let’s say that we choose this lithography.
  • 0:31 - 0:36
    As is, it wouldn’t look too good and
    I must remove the background, but
  • 0:36 - 0:40
    I can do this very quickly and very easily
    with Gimp, using almost only options from the
  • 0:40 - 0:45
    “Colors” menu. First thing, let’s get
    rid of this pink beige color
  • 0:45 - 0:50
    old paper background. In the
    “Colors” menu, “Desaturate” will
  • 0:50 - 0:55
    turn everything to shades of greys. But
    I don’t want grey. In the same menu,
  • 0:55 - 1:00
    I’m going to switch to “Brightness-Contrast”,
  • 1:00 - 1:10
    and boldly push contrats to the maximum.
  • 1:10 - 1:15
    switching “Color to Alpha”. The Alpha channel,
    if you remember the previous video, is
  • 1:15 - 1:19
    associated with transparency – and even
    if you have forgotten to state that your image
  • 1:19 - 1:24
    knows transparency, this option will enable
    it automatically. By default, the color to
  • 1:24 - 1:29
    make transparent is white, which is
    what we want. Click OK, and we get
  • 1:29 - 1:33
    a good lithography that we can use
    with anything. Perhaps that we’ll remove
  • 1:33 - 1:36
    the legend an the name of the long-dead,
    artist, which we can achieve by
  • 1:36 - 1:40
    selecting with the lasso and cutting.
    Then, why not, we can add Pascal’s
  • 1:40 - 1:44
    own signature, found on the web
    and that went through a very
  • 1:44 - 1:47
    similar process. Done, in a record time.
  • 1:47 - 1:52
    At this point, we can stop and think.
    I have no clue about where this Pascal
  • 1:52 - 1:55
    portrait is coming from, but my
    guess is that this lithography dates back
  • 1:55 - 2:00
    to the 1830s/1840s, and smacks of romanticism.
    It doesn’t look like an authentic portrait.
  • 2:00 - 2:06
    In fact, this poor Pascal rather looks like
    a teen-age idol in this lithography. Is that
  • 2:06 - 2:09
    the way I want him to look?
    Not so sure.
  • 2:09 - 2:13
    Let’s happily go from one extreme to the other.
    I’ve found this stamp, still on Internet.
  • 2:13 - 2:17
    Technically speaking, it’s an engraving,
    but here it rather looks like
  • 2:17 - 2:21
    Dr Frankenstein’s failed first attempt.
    Aside from style, let’s check how we
  • 2:21 - 2:25
    can make this portrait usable, because
    techniques that were previously used
  • 2:25 - 2:29
    won’t give a good result here.
    The image is a .jpg file, I’m therefore
  • 2:29 - 2:35
    first going to add transparency, the famous
    “Alpha channel”. Next, I don’t want
  • 2:35 - 2:38
    this portrait to look like a stamp.
    I’m going to use the selection tool in
  • 2:38 - 2:42
    the toolbox, and draw a rectangle
    around the area of the image that I want
  • 2:42 - 2:49
    to keep. In the “Image” menu I’m going
    to choose “Crop to Selection”,
  • 2:49 - 2:56
    Here is what I’m going to work with.
  • 2:56 - 3:00
    First of all, I’m going to remove the background
    around the head, using the lasso a little,
  • 3:00 - 3:04
    and the eraser much. I’m getting an image
    that wouldn’t be that bad, except for
  • 3:04 - 3:09
    something very ugly, those awful straight
    lines. What is the issue? I won’t be able
  • 3:09 - 3:14
    to place the head wherever I want. In fact,
  • 3:14 - 3:17
    even if I put it in a corner, I’ll always have
    a straight line to remind that it’s a plain
  • 3:17 - 3:22
    cropped stamp. Contrast this with
    the previous lithography, with its
  • 3:22 - 3:27
    curves and lower dim area, which
    allows any type of lay-out. In fact,
  • 3:27 - 3:31
    We can get a similar effect with Gimp
    for any type of image and I do
  • 3:31 - 3:35
    it almost systematically with portraits.
    Here is how.
  • 3:35 - 3:40
    We’ll use a filter, the one under “Decor”
  • 3:40 - 3:48
    called “Fuzzy Border”. When the option windows appear
  • 3:48 - 3:51
    Two things need to be changed.
    The first one is the “flatten
  • 3:51 - 3:55
    image” option, which generates a single-layer
  • 3:55 - 4:00
    image. I want to update the layers after
    the filter has run,and I must uncheck
  • 4:00 - 4:04
    this option.
    The second thing is the border size.
  • 4:04 - 4:07
    Out of experience, what works best is
    a border the size of which is around
  • 4:07 - 4:13
    about 1/7th or 1/8th of the smallest
    image dimension – obviously, it doesn’t
  • 4:13 - 4:16
    need to be precise down to the pixel,
    I always wildly round numbers. Here,
  • 4:16 - 4:22
    my image is about 300 by 400, and I’ll
    use a value of 40 for the border. I apply
  • 4:22 - 4:27
    the filter, and I get a two-layered copy
    of the image, with a top layer (that
  • 4:27 - 4:32
    happens to be the active one) being a
    kind of fuzzy white frame. I want to
  • 4:32 - 4:36
    see some things fuzzy, mostly the chest,
    but not everything and not the head. So I’m
  • 4:36 - 4:40
    going to use the lasso to select the part
    of the mask that I want to remove, over the
  • 4:40 - 4:45
    shoulders.You’ll notice that the lasso
    allow you to move outside the image and
  • 4:45 - 4:51
    circle around it from a distance. This
    area, I remove it. At this point, you shouldn’t
  • 4:51 - 4:56
    forget to go the the selection
    menu and choose “All”.
  • 4:56 - 4:58
    If you don’t, you may have surprises in
    the next steps.
  • 4:58 - 5:05
    OK, now we have two layers, the
    top layer which is the active one
  • 5:05 - 5:09
    (here indicated by a red frame) and
    contains a blurred mask, and the bottom
  • 5:09 - 5:14
    layer, the portrait proper. I go
    to the 'Layer' menu and choose
  • 5:14 - 5:20
    to duplicate the current layer. Using
    the layers window I’m going to select
  • 5:20 - 5:25
    the bottom layer, and duplicate it
    as well. Now, it’s getting complicated.
  • 5:25 - 5:29
    I select any of the two blurred masks and
    in the “Colors” menu I select “Invert”.
  • 5:29 - 5:36
    It becomes black. And now beware, the
    order needs to be precise: using arrows
  • 5:36 - 5:42
    in the layers window, I’m going to place,
    from top to bottom, the white mask, one Pascal,
  • 5:42 - 5:47
    the black mask, and the second Pascal. I
    make one of the two masks, here the black one,
  • 5:47 - 5:52
    the active layer and click on
    “Merge down” in the “Layer” menu.
  • 5:52 - 5:57
    I do the same with the other mask.
  • 5:57 - 6:01
    Now, let’s deal with transparency: we
    we select the top layer, then, in the
  • 6:01 - 6:05
    Colors menu, we are going to click on what
    we have already seen, “Color to Alpha”,
  • 6:05 - 6:11
    and make white transparent. then we select
    the other layer but we’ll change the color
  • 6:11 - 6:16
    to make transparent by clicking the color
    and switching from white to black.
  • 6:16 - 6:20
    This time, black will disappear and I’m
    going to end-up with a rather ghostly layer.
  • 6:20 - 6:25
    So ghostly in fact that usually I’ll
    duplicate it and then merge the two
  • 6:25 - 6:27
    clones, which will give it a bit more consistency.
  • 6:27 - 6:33
    And here we are, we have fuzzy image border.
    If you need to put this image on a dark
  • 6:33 - 6:37
    background, I’ll advise you to add a black
    layer at the very bottom, and inspect
  • 6:37 - 6:41
    closely. Very often you notice in the
    light layer that previous erasures
  • 6:41 - 6:45
    were so so, and sometimes you have
    a slight halo that doesn’t look too good.
  • 6:45 - 6:52
    All this is easy to fix with the eraser.
    When everything is OK, you can remove
  • 6:52 - 6:56
    the black layer, and merge the two remaining
    layers. There is one remaining problem that
  • 6:56 - 7:00
    doesn’t show too much here but is very noticeable
    on a color image: I have removed white and I have
  • 7:00 - 7:04
    removed black, so globally I have removed
    grey. Removing grey from colors, that’s
  • 7:04 - 7:08
    the opposite of making them greyer, and
    therefore I have saturated colors. I can
  • 7:08 - 7:12
    swear you that with a color picture
    the soberest individual will look
  • 7:12 - 7:17
    like a second Falstaff. This is why
    I usually end up with the “Colors” menu
  • 7:17 - 7:22
    and roughly desaturate colors, trying to
    match colors in the original picture.
  • 7:22 - 7:27
    I end up with an image that is far easier to use.
    In this particular case,
  • 7:27 - 7:30
    I still have a small straight line. It’s no
    big deal, I just have to line up this side
  • 7:30 - 7:35
    with the edge. And finally, aesthetic choices
    apart, the stamp ends up being quite equivalent
  • 7:35 - 7:37
    to the lithography.
  • 7:37 - 7:42
    With all this, how do I introduce Pascal’s
    computing machine? Not like this,
  • 7:42 - 7:47
    as you may guess. Here is what I have
    shown for real during a lecture to my
  • 7:47 - 7:53
    American students. First of all, drum roll:
    a date, which corresponds to nothing
  • 7:53 - 7:57
    known because as anybody knows between
    1492 and 1776 not much happened.
  • 7:57 - 8:03
    This is puzzling. With the date, I associate
    an exotic location – I have found, still
  • 8:03 - 8:08
    on the web, a map of Rouen (modern spelling) in 1655,
    a few years later. I guess that at this time
  • 8:08 - 8:14
    cities were evolving slowly. The plot
    thickens. Then another Pascal portrait
  • 8:14 - 8:20
    that I initially prepared as a background
    for quotes. And finally over this
  • 8:20 - 8:24
    the computing machine. Needless to say,
    I could now use as well the transformed
  • 8:24 - 8:30
    stamp, with colors that harmonize better with it.
  • 8:30 - 8:35
    There is a light topic I want to talk of,
    screenshots. There are tons of ways to
  • 8:35 - 8:39
    get a screenshot, you can very easily
    do it with Gimp, under the
  • 8:39 - 8:45
    File/Create/Screenshot menu. You
    can take a fullscreen image,
  • 8:45 - 8:49
    or only a window or an arbitrary area,
    and it’s very useful, first for
  • 8:49 - 8:53
    presentations where software tools
    appear, but not only as you
  • 8:53 - 8:55
    are going to see.
  • 8:55 - 8:59
    I like to eat my own dog food, and as
    in the videos about shapes I mostly
  • 8:59 - 9:02
    used shapes, in this and the
    previous ones I have amply used
  • 9:02 - 9:05
    images, including many shots of my own screen.
  • 9:05 - 9:11
    If there is something I don’t like
    in a video recording of one’s own
  • 9:11 - 9:16
    screen, it’s how indiscreet it can be.
    You needn’t know whether I’m running on
  • 9:16 - 9:22
    Windows, Linux or Mac. It’s none
    of your business. And wallpapers!
  • 9:22 - 9:26
    I don’t want to let you know whether
    the gentleman that I am prefers blondes
  • 9:26 - 9:35
    ... or something else.
  • 9:35 - 9:40
    One confidence: Jack Lemmon isn’t my type of girl;
    but I like movies.
    I don’t want you either to know if
  • 9:40 - 9:44
    my legendary repute for modesty is well
    grounded, or whether I am actually hiding
  • 9:44 - 9:50
    slightly megalomaniac tendencies.
    Solution? Take a screenshot of THE window
  • 9:50 - 9:55
    of interest, and show nothing but this window.
    Even better, only show from the window
  • 9:55 - 9:59
    the part I am talking about, and I can even
    play with blurring and desaturation to
  • 9:59 - 10:02
    focus on ONE precise point. No distraction.
  • 10:02 - 10:08
    If using screenshots is natural in
    a presentation linked to programming
  • 10:08 - 10:12
    or IT topic, you can use them in a
    far subtler way. Imagine that I
  • 10:12 - 10:16
    want to talk about set operations,
    and show intersection, union and
  • 10:16 - 10:17
    difference between two sets.
  • 10:17 - 10:23
    I can use two circular shapes in different
    colors to represent my sets.
  • 10:23 - 10:28
    The snag, it’s that when I put them together
    I cannot show easily intersection,
  • 10:28 - 10:32
    union and difference. All right, for union
    I might change colors and give the same
  • 10:32 - 10:36
    color to both shapes; but the single
    black circular arc in the middle ruins
  • 10:36 - 10:42
    symmetry. For intersection, I can make
    colors transparent, and intersection
  • 10:42 - 10:45
    appears different, but this doesn’t leave
    many options when choosing colors.
  • 10:45 - 10:47
    To show the difference, it’s kind of hopeless.
  • 10:47 - 10:54
    What shall I do? These shapes are in my
    Powerpoint window. I’m going to zoom
  • 10:54 - 10:58
    over them as much as possible (I set the slide
    view option at 200%) and take a screenshot.
  • 10:58 - 11:04
    I’m going to remove the background of this image
    and color three different versions. As an
  • 11:04 - 11:07
    aside, I won’t elaborate on it, but to
    color an image is far less easy than it
  • 11:07 - 11:11
    looks, I often use two layers, only
    keeping black lines in the top
  • 11:11 - 11:17
    one and splashing colors in the bottom layer.
    And know, what shall I do? First
  • 11:17 - 11:22
    slide, my shapes, which are separately animated.
    Next slide, fade over an image that I have
  • 11:22 - 11:26
    sized to exactly match the size of the
    shapes and that I have put on screen
  • 11:26 - 11:29
    exactly at the same place as the shapes
    in the previous slide. It’s like a
  • 11:29 - 11:38
    stuntman replacing the star. Another image,
    another image, and back with shapes.
  • 11:38 - 11:42
    I have have shown what I wanted, nobody
    saw substitutions nor technical switches,
  • 11:42 - 11:47
    the message got through. And what shall
    we talk about next? Animations and
  • 11:47 - 11:48
    transitions, of course.
Title:
Pythonneries - Making Of 7
Description:

more » « less
Duration:
12:00

English subtitles

Revisions