☰ Contents · Computing

Channels and filters

Lessons 13 · 1 lessons · N. I. Taylaqov (general editor), A. B. Akhmedov, M. D. Pardayeva, A. A. Abdug‘aniyev, U. M. Mirsanov. Informatics and Information Technologies, Grade 11, 1st edition. “Extremum-press”, Tashkent, 2018
13

Channels and filters

Textbook: pp. 49–50
GoalShows and hides the colour components of a picture with the Channels palette, explains the job of an alpha channel and applies filters while being able to say how they work.
New words
channel: one colour component of a picture, stored as a grayscale image · kanalalpha channel: an extra channel that stores a selection or transparency · alfa-kanalfilter: processing of a picture by a predefined algorithm · filtrGaussian Blur: a filter that blurs by replacing each pixel with a weighted average of its neighbours · Gaussian Blur
Explanation

In a colour system every colour splits into components: red, green and blue in RGB; cyan, magenta, yellow and black in CMYK. Each component of a picture is stored in its own channel as a grayscale image: an RGB picture has three colour channels and a CMYK picture has four; the Channels palette (Window → Channels) also shows their combined view at the top. Clicking the eye next to a channel shows or hides it; in Windows Ctrl+3, Ctrl+4 and Ctrl+5 show the red, green and blue channels and Ctrl+2 shows the combined picture. A red apple looks light in the red channel and dark in the blue channel, because it has little blue light. To see CMYK, choose Image → Mode → CMYK Color. Besides colour channels there is an alpha channel: it stores a selection (white – selected, black – not) or transparency; Select → Save Selection writes a selection into a channel. A filter is processing of a picture by a predefined algorithm. For example, Gaussian Blur blurs the picture by replacing each pixel with a weighted average of its neighbours (nearer neighbours count more); Invert subtracts each channel value from 255. Filters are grouped in the Filter menu (Blur, Sharpen, Noise, Stylize, Distort and others); Ctrl+F applies the last filter again, and if the result is unwanted, Ctrl+Z or the History palette helps. A filter applied to a selection changes only part of the picture. When you work with AI filters and programs that alter a person's face, do not hide that the picture was changed, and do not alter someone's picture without permission.

Worked examples
Blurring a portrait background: we select the background with the Magic Wand (adding missed places with Shift), then set a radius of 8 pixels in Filter → Blur → Gaussian Blur; the person is outside the selection, so stays sharp. If the result is unwanted, Ctrl+Z; to blur once more, Ctrl+F.
A filter's algorithm: Invert changes the pixel (200, 100, 30) to (255–200, 255–100, 255–30) = (55, 155, 225). In a 3×3 average blur the centre pixel's new value is the average of the 9 neighbouring values: for 10, 20, 30, 40, 50, 60, 70, 80, 90 it is (10+…+90):9 = 450:9 = 50.
Class activity

“Channel magic”: students show the red, green and blue channels of a colour picture one after another and write in a table in which channel each object (red flower, green leaf, sky) is lightest.

Practice
1
How many colour channels do RGB and CMYK pictures have?
2
To what value does the Invert filter change a channel value of 90?
3
In a 3×3 blur the 9 values around the centre are 12, 18, 24, 30, 36, 42, 48, 54, 60. What is the centre's new value?
4
Why does a red apple look dark in the blue channel?