Return to Video

Pythonneries - Making Of 6

  • 0:08 - 0:09
    Hello,
  • 0:09 - 0:12
    It’s time to talk about picture editing.
    It’s an ample topic, we could make
  • 0:12 - 0:17
    a tutorial series on this topic alone,
    I’ll only have two videos and will stick
  • 0:17 - 0:22
    to a few principles and methods without trying
    to cover everything. I guess you can find
  • 0:22 - 0:24
    additional information elsewhere.
  • 0:24 - 0:28
    I’ve seen many presentations where
    the laudable intent of adding visuals
  • 0:28 - 0:33
    was marred by a clumsy realization. For
    instance, an introductory class to
  • 0:33 - 0:36
    programming often starts with an
    historical overview where is mentioned
  • 0:36 - 0:41
    the first mechanical computer designed
    by Blaise Pascal when he was 19 years old.
  • 0:41 - 0:46
    Too often, it appears a bit like this.
    I’m sorry, but it looks like “our class trip".
  • 0:46 - 0:51
    I wouldn’t mind seeing something like this
  • 0:51 - 0:55
    in a junior high-school presentation, but
    it doesn’t look professional. Yet you’ll often
  • 0:55 - 0:58
    see it, in a company, during a class, or
    at technical conferences.
  • 0:58 - 1:04
    There are several possible ways to well
    integrate a picture to a presentation.
  • 1:04 - 1:08
    First solution, the full-screen image,
    much loved by Garr Reynolds, among others.
  • 1:08 - 1:13
    There may be a slight issue with text if
    you have some (which isn’t mandatory)
  • 1:13 - 1:17
    because contrast can be poor. In
    that case, a solution may be
  • 1:17 - 1:23
    to paste a rectangle, a shape, over the text,
    to change the fill color of this shape
  • 1:23 - 1:29
    to white or light grey, to
    make it say 50% transparent,
  • 1:29 - 1:34
    then, by playing with how elements are
    stacked over the slide, to place
  • 1:34 - 1:41
    the rectangle between picture and text. Small
    but important point, make sure that
  • 1:41 - 1:45
    this rectangle lines up on at
    least one side with an edge,
  • 1:45 - 1:47
    a rectangle lost in the middle doesn’t
    look too good.
  • 1:47 - 1:51
    Another solution, which I like better
    but isn’t always an option, is
  • 1:51 - 1:55
    to find a color with a strong contrast with
    the background image. If your image is a succession
  • 1:55 - 1:59
    of very light and very dark areas under
    the text, the transparent rectangle remains
  • 1:59 - 2:00
    the backup solution.
  • 2:00 - 2:05
    Unfortunately, it happens that the only
    suitable picture you find on a topic is
  • 2:05 - 2:07
    small. And in that case, when you increase
    its size to the screen size, pixels
  • 2:07 - 2:12
    appear. Ugly. This problem usually becomes
    a concern when the smaller dimension of your
  • 2:12 - 2:16
    image is under about 700 pixels, and
    unfortunately I have already seen
  • 2:16 - 2:20
    images that ugly in professional presentations.
    There are two tactics for coping with it,
  • 2:20 - 2:26
    camouflage or living with it.
    For camouflage, if you are using Powerpoint
  • 2:26 - 2:29
    the image menu shows on the left something
    called “filters”. You can
  • 2:29 - 2:34
    experiment with different filters, I’m
    using here fore instance the one called
  • 2:34 - 2:39
    “Line Drawing”. It hides a bit too much,
  • 2:39 - 2:44
    but you can adjust transparency that
    I am here increasing from 25 to
  • 2:44 - 2:50
    50%. Additionally, I’m going to play with colors
    and desaturate them, that means making
  • 2:50 - 2:54
    then greyer so that visually the image pulls
    back a little. You can argue about the filter
  • 2:54 - 2:58
    choice, you may like or not and I’m going
    to show you soon something that isn’t
  • 2:58 - 3:01
    in Powerpoint and that I find better,
    but one sure is certain, it’s that it’s
  • 3:01 - 3:05
    the same image, in the same resolution as before,
  • 3:05 - 3:11
    and pixels have vanished.
    If you prefer living with it, keep your image
  • 3:11 - 3:15
    small enough so that resolution remains
    acceptable but make it look like a
  • 3:15 - 3:19
    a paper picture by adding to it a narrow white
    margin and a shadow, one of the standard
  • 3:19 - 3:23
    image formatting options. Icing on the cake,
    tilt the image a little.
  • 3:23 - 3:27
    This works very well if you have
    several images on the same topic,
  • 3:27 - 3:32
    with none of them astounding but that
    work well as a set.
  • 3:32 - 3:37
    As long as you have a good enough
    resolution (or if you cheat),
  • 3:37 - 3:40
    full-screen display is a nice solution
    but prevents from having more than
  • 3:40 - 3:44
    a few words on the slide. The most flexible
    solution is probably to remove the image background
  • 3:44 - 3:47
    to only keep what is truly interesting.
  • 3:47 - 3:53
    Once again, the Powerpoint image editing
    menu shows a button labelled
  • 3:53 - 3:59
    “remove background” which is a rather
    impressive tool.
  • 3:59 - 4:01
    I’ve used it for instance to erase the grey
    background of this stamp.
  • 4:01 - 4:06
    The only snag is that, as with everything that is
    automated, result quality varies.
  • 4:06 - 4:09
    It will be excellent with a strong contrast
    between the background and the foreground,
  • 4:09 - 4:14
    but when you have to guess the edges there are
    some worries. For instance, I couldn’t do
  • 4:14 - 4:17
    any better than this with Pascal’s computing
    machine. You can see that there are
  • 4:17 - 4:20
    several points where obviously
    software couldn’t clearly identify
  • 4:20 - 4:24
    the edges, and showing something as
    approximate is embarrassing in a
  • 4:24 - 4:29
    presentation.This result, I got it
    by hand.
  • 4:29 - 4:33
    The tool I use for editing images
    is Gimp, which is not only free but
  • 4:33 - 4:37
    also a fantastic tool that I have as
    happily used on Linux, Windows,
  • 4:37 - 4:42
    and Mac. There are many books
    on Gimp, I will only give
  • 4:42 - 4:46
    a very very brief overview of techniques
    I find useful for making images more
  • 4:46 - 4:50
    suitable for a presentation.
    For instance, hiding pixels.
  • 4:50 - 4:56
    Gimp has a wider range of filters than
    Powerpoint. First, you open the
  • 4:56 - 5:01
    small image, and resize it with the Image/Scale
    Image menu so that its smaller dimension
  • 5:01 - 5:07
    is in the 750 to 800 pixels range.
    The resulting image isn’t pretty,
  • 5:07 - 5:11
    but there is in the filters menu
    under“Artistic” something which I like
  • 5:11 - 5:15
    much and is called “oilify”,
    in other words “oil painting”.
  • 5:15 - 5:19
    Basically, pixels will turn to paint
    spots with an ajustable radius
  • 5:19 - 5:25
    the default value of which is 8. I often
    bring it down to 3 when I want to keep some
  • 5:25 - 5:30
    detail. Here I’ve kept default parameters.
    In the “Colors” menu, I can adjust hue
  • 5:30 - 5:34
    and saturation. As with the Powerpoint filter
  • 5:34 - 5:40
    I’m going to desaturate my picture.
    Now I can export it to a .jpg or .png
  • 5:40 - 5:44
    file (beware, it the latest Gimp
    versions “Save” writes images in
  • 5:44 - 5:48
    an XCF format only used by Gimp).
  • 5:48 - 5:52
    I just have to import it into
    Powerpoint, add text, here with
  • 5:52 - 5:57
    fancy “period” fonts and you’re done.
  • 5:57 - 6:00
    But this kind of easy transform is just a
    drop in the ocean of what Gimp allows
  • 6:00 - 6:05
    you to do. I was previously mentioning
    background removal, and I first need
  • 6:05 - 6:09
    to tell you a couple of things about
    images and Gimp.
  • 6:09 - 6:13
    Firstly, images that you will find will
  • 6:13 - 6:19
    mostly be .JPG files (pictures, generally
    speaking), .GIF files (drawings and logos),
  • 6:19 - 6:25
    or .PNG files (everything). Removing the background
    implies that the format can display transparent areas,
  • 6:25 - 6:30
    which .JPG files cannot do. Many interesting
    Gimp features are similarly unavailable if you
  • 6:30 - 6:35
    keep the special color encoding of your .GIF files.
    With Gimp, the original format matters little:
  • 6:35 - 6:41
    it can convert everything. However, it’s best to export
  • 6:41 - 6:45
    your edited image as a .PNG file when you are done
    (and if you save an image before it’s completely
  • 6:45 - 6:50
    modified, it’s better to use the .XCF
    Gimp file format).
  • 6:50 - 6:56
    Before you start working on a file, you must
    make sure of two things. First , in the
  • 6:56 - 7:02
    Image/Mode menu, that the RGB option is
    selected. It won’t be the case if you
  • 7:02 - 7:07
    have opened a .GIF file. Select this
    option, otherwise many options will be
  • 7:07 - 7:14
    deactivated in menus. Next, transparency.
  • 7:14 - 7:18
    Go to the “Layer” menu and check
  • 7:18 - 7:22
    the transparency submenu. If option
    “Add Alpha Channel” is deactivated,
  • 7:22 - 7:28
    it’s OK, your image can be transparent.
    Otherwise, select it. Whatever is
  • 7:28 - 7:32
    transparent is displayed in Gimp as
    a grey checkerboard.
  • 7:32 - 7:36
    Now let’s take a look at tools. Depending
    on the Gimp versions, some windows
  • 7:36 - 7:40
    may or may not be opened at launch.
    If they aren’t, you must select them
  • 7:40 - 7:45
    from the Windows menu. The first, almost
    mandatory one, is the “Toolbox”
  • 7:45 - 7:48
    Don’t be scared by the impressive number
  • 7:48 - 7:51
    of tools, I always use the same small set
  • 7:51 - 7:56
    of easy tools. The other window
    is the one called “layers”,
  • 7:56 - 8:00
    As you’ll soon see, some changes require working
  • 8:00 - 8:03
    on multiple copies of the image, which
    you stack up and change separately.
  • 8:03 - 8:08
    Finally, the last useful window is
    the one called “Tool Options”,
  • 8:08 - 8:11
    which associates with each tool in the toolbox
    specific options.
  • 8:11 - 8:16
    I rarely change options, but this window
    is very useful for some tools such as
  • 8:16 - 8:20
    the eraser, the size of which you often want to change.
  • 8:20 - 8:24
    To remove the background, the best tool is
    the lasso, which allows you to circle
  • 8:24 - 8:29
    around parts of an image. Using it is simple.
    First of all, I advise you to zoom as much
  • 8:29 - 8:34
    as possible on the area of interest.
    Then, either you keep the mouse clicked down
  • 8:34 - 8:38
    and follow any curve you want, or, what I
    always do, you draw straight line
  • 8:38 - 8:43
    segments and only click to change direction.
    With an object with mostly straight edges
  • 8:43 - 8:47
    such as Pascal’s machine, straight lines are
    the obvious choice. When the image is almost
  • 8:47 - 8:52
    fully circled, double-click and Gimp will
    close the loop and indicate that the
  • 8:52 - 8:56
    circled part is selected. It’s not this part that
    we want to remove, but everything else.
  • 8:56 - 9:01
    Therefore we’ll go to the ‘select’ menu,
    click on ‘Invert’, then cut from either
  • 9:01 - 9:06
    the ‘edit’ menu or by using usual keyboard
    short-cuts. At this stage, there will
  • 9:06 - 9:09
    be certainly some small details to
    improve and, if the image isn’t
  • 9:09 - 9:12
    very geometrical, there may be significant
    work to be completed. Here, your tool
  • 9:12 - 9:16
    will be the eraser. Default options are
    very good, the only thing that you may
  • 9:16 - 9:20
    have to change is the size, and it’s
    better to zoom strongly over the area
  • 9:20 - 9:24
    that you are working on. If you make a wrong
    move, no panic, you can undo everything
  • 9:24 - 9:29
    with Gimp. I’ve made a lot of wrong moves ..
    Here is for principles, next
  • 9:29 - 9:30
    time a practical example.
Title:
Pythonneries - Making Of 6
Description:

more » « less
Duration:
09:33

English subtitles

Revisions