IntermediateLesson 17 of 306 min read

Editing Images: Brightness, Transparency and Shadows

Learn what brightness, contrast, opacity and shadows really do, with measured changes to a test picture and a hand check of see-through blending.

In this lesson you will

  • Use brightness and contrast with care
  • Understand opacity as a blend
  • Make a subtle shadow
  • Know when to remove a background

About 22 minutes

A good photo with a flat look

Priya takes a photo of the children’s corner on a cloudy afternoon. It is sharp and well framed, but dull: grey, a little dark, no sparkle. She wants it for the reading club poster, with the club’s name over the bottom edge in white. She tries a filter and it looks fake. She slides the brightness all the way up and the whites burn out. What she needs is not more effects but a feel for what each control does, so that she can make small, careful changes. This lesson explains the main controls in plain terms and tests them on numbers.

The basic controls

  • Brightness makes the whole picture lighter or darker.
  • Contrast widens or narrows the gap between lights and darks. More contrast looks punchier, less looks softer.
  • Saturation makes colours more or less vivid.
  • Warmth and tint shift the colours towards one end of the colour range, to feel cosier or cooler.
  • Sharpness crisps edges. A little goes a long way.
  • Filters and effects apply a ready-made combination. Use them gently, and keep them the same across a series.

Canva offers photo editing controls in its editor, and some tools such as automatic background removal or magic eraser may depend on your plan. If a control is missing, check your plan and your device before looking for a fault.

What these controls do to the numbers

Every picture is numbers, so every control can be measured. The program below builds a small test picture, a blue-grey gradient with a lighter circle, and then applies brightness and contrast with Pillow, an image library for Python. For each, it measures the average lightness of the picture, on a scale from 0, black, to 255, white, and, for contrast, the spread of lightness values. Then it does something more useful for design: it places a see-through label over the picture and checks the blending by hand. Last, it makes a soft shadow.

from PIL import Image, ImageDraw, ImageEnhance, ImageFilter, ImageStat

def mean_light(img):
    return ImageStat.Stat(img.convert("L")).mean[0]

photo = Image.new("RGB", (800, 600))
d = ImageDraw.Draw(photo)
for y in range(600):
    v = round(60 + 90 * y / 599)
    d.line([(0, y), (800, y)], fill=(v, v + 10, v + 30))
d.ellipse((250, 150, 550, 450), fill=(120, 140, 200))

base = mean_light(photo)
for name, factor in (("brighter 1.2", 1.2), ("darker 0.8", 0.8)):
    out = ImageEnhance.Brightness(photo).enhance(factor)
    print(f"{name}: {base:.1f} -> {mean_light(out):.1f}")
flat = ImageStat.Stat(ImageEnhance.Contrast(photo).enhance(0.5).convert("L")).stddev[0]
sharp = ImageStat.Stat(ImageEnhance.Contrast(photo).enhance(1.5).convert("L")).stddev[0]
print(f"contrast spread: {flat:.1f} (low) / {sharp:.1f} (high)")

# a see-through label over the photo, with 40 per cent opacity
label = Image.new("RGBA", photo.size, (0, 0, 0, 0))
ImageDraw.Draw(label).rectangle((0, 450, 800, 600), fill=(20, 17, 46, 102))
result = Image.alpha_composite(photo.convert("RGBA"), label).convert("RGB")
before, after = photo.getpixel((10, 500)), result.getpixel((10, 500))
by_hand = tuple(round(0.4 * c1 + 0.6 * c2) for c1, c2 in zip((20, 17, 46), before))
print("pixel before:", before)
print("pixel after:", after)
print("by hand:", by_hand)

# a soft shadow: blur a copy of the alpha channel
logo = Image.new("RGBA", (300, 300), (0, 0, 0, 0))
ImageDraw.Draw(logo).ellipse((40, 40, 260, 260), fill=(90, 40, 200, 255))
shadow = Image.new("RGBA", logo.size, (0, 0, 0, 0))
shadow.putalpha(logo.split()[3].filter(ImageFilter.GaussianBlur(12)))
print("shadow reaches beyond the logo:", shadow.getpixel((30, 150))[3] > 0 and logo.getpixel((30, 150))[3] == 0)
brighter 1.2: 118.0 -> 141.4
darker 0.8: 118.0 -> 93.9
contrast spread: 13.6 (low) / 41.0 (high)
pixel before: (135, 145, 165)
pixel after: (89, 94, 117)
by hand: (89, 94, 117)
shadow reaches beyond the logo: True

Brightness first. The test picture has an average lightness of 118.0. Raising brightness by a factor of 1.2 lifts that to 141.4, a change close to 20 per cent, and a factor of 0.8 brings it down to 93.9. So a brightness control is a simple multiplier, which is why pushing it too far makes bright areas hit the maximum and lose all detail, the burned-out look Priya got. Contrast works on the spread. Halving the contrast gives a spread of 13.6, and raising it by half gives 41.0: the same picture, but with lights and darks pushed far apart. Small moves are enough. A change of 10 or 20 per cent is usually plenty.

See-through layers

Priya wants white text on the bottom of the photo. White text on a busy picture can fail the contrast test from lesson 6, so she adds a dark panel behind it. A solid panel can look heavy, so she makes it partly see-through. The program lays a dark label at 40 per cent opacity over the bottom of the picture, then checks one pixel. Before, it was (135, 145, 165). After the label, it is (89, 94, 117). The by-hand sum, 40 per cent of the label colour plus 60 per cent of the original, gives (89, 94, 117), exactly the same. That is how opacity works everywhere: each colour channel becomes opacity times the top colour plus the rest times the one below. Knowing this means you can predict the result, and choose an opacity that gives enough darkness for your text, rather than sliding it by eye.

Then check the text. After adding the panel, test the white text against the darkened area, not the original photo, because that is what the reader sees.

Shadows

The last part of the program makes a soft shadow. It copies the shape of a round logo, blurs the copy and finds that the shadow spreads beyond the edge of the logo, which is exactly what makes a shadow look soft. In an editor, shadow controls usually ask for an offset, a blur and an opacity. A good shadow is subtle: low opacity, plenty of blur and a small offset downwards, as if light came from above. A harsh shadow looks like clip art.

Background removal and see-through images

Removing the background of a photo, to put a person or product on a colour, is a popular feature, and Canva offers it on some plans. The result is an image with a see-through background, which you saw in lesson 9 needs a format such as PNG. Check the edges at a large size, especially hair and fine detail, and add a slight soft shadow so the cut-out sits naturally on its new background.

Common mistake: too much of everything

Over-editing. Heavy contrast, strong saturation and a bright filter can make a photo look unnatural, and every photo in a series then looks different. Make small changes and apply the same ones to every photo in the set.

Keep the original

Edit a copy, not your only original, especially for print. Keep the original photo file safe, because it has the most pixels and the most flexibility, as lesson 7 explained.

Take one photo and make three versions: brightness up a little, contrast up a little, and both. Compare them on your phone. Which edit changed the picture most, and which looked most natural?

Practice for this lesson

Check what you learned

Five quick questions. Pick an answer and you will see straight away whether it is right and why.

What does a brightness control do to a picture?

  1. Changes the file type
  2. Crops the edges
  3. Lightens or darkens the whole picture
  4. Removes the background

Brightness is a multiplier on the lightness of every pixel.

What happens if you push brightness too far?

  1. Bright areas lose detail
  2. The picture gets sharper
  3. Colours change names
  4. The file shrinks

Bright areas hit the maximum and detail disappears, giving a burned-out look.

Which control widens the gap between lights and darks?

  1. Saturation
  2. Crop
  3. Contrast
  4. Tracking

Higher contrast pushes lights and darks apart, and lower contrast pulls them together.

How does a 40 per cent dark label change a pixel?

  1. 40 per cent label plus 60 per cent original
  2. It removes the pixel
  3. It doubles the pixel
  4. It makes it white

Each channel is opacity times the top colour plus the remainder times the one below.

What makes a shadow look soft?

  1. More saturation
  2. Blur
  3. Smaller font
  4. A thinner line

Blurring spreads the shadow past the edge of the shape, which makes it look soft.

Summary

  • Brightness multiplies lightness, and contrast widens or narrows the spread.
  • Opacity blends colours by a simple sum you can check by hand.
  • A good shadow is soft, subtle and slightly offset.
  • Edit copies, keep originals, and keep a series consistent.

Next lesson

Lesson 18 adds movement: animation and video basics.

Questions

Do I need photo editing software as well?

Not for most posts. Canva's editing controls cover brightness, contrast, crops and filters. For delicate retouching, a dedicated photo editor is better.

Why does my cut-out photo look pasted on?

Often there is no shadow, or the edge is too sharp. Add a soft shadow and check the edges at a large size.

Should I use the same filter on every photo?

In a series, yes. Using the same small set of edits makes photos look like they belong together.

Progress is saved in this browser.