Skip to main content

Featured

Space Explorers Book 7: Answers and Explanations

Memunic Space Explorers › Book 7: Memoon and the Search for Another Home › Answers and Explanations Answers and Explanations Habitable means life could live there; inhabited means life does live there. A world can be habitable and empty, as an unoccupied flat has a roof and water but nobody in it. The Moon has almost no air, so water would boil or freeze, and its gravity is only about one-sixth of Earth’s, too weak to keep air. Accept also: no greenhouse blanket, so it swings between very hot and very cold. Venus. It matches Earth in size and roughly in mass, but its thick carbon dioxide air traps heat, making it hot and crushing. “Twin” is only true for size and weight. A dip of 1 per cent means (planet width divided by star width) squared is 0.01, so the ratio is 0.1: the planet is about a tenth as wide as the star. Repeats at the same gap show the planet is going round the star in 12 days, and rule out a one-time event such as a passing object. A planet shines only by reflected l...

Byte by Byte Book 6: Chapter 12 – Image Editing with Layers

Byte by Byte › Book 6: Python, Data and How Computers Work › Chapter 12: Image Editing with Layers

Chapter 12: Image Editing with Layers

You will learn: the difference between raster and vector graphics, how to crop, resize, rotate and adjust photos, what layers are and why designers use them, how to add, hide, reorder and merge layers in Paint, how transparency and background removal work, basic design principles for posters, and how to edit images honestly.

🌟 The Adventure

Pip spread her photos across the table. The Festival of Tides had been magical, but her camera had struggled underwater. Most of the pictures were murky and dark. And in the best one, a large, round, extremely grumpy pufferfish had swum straight in front of the lens, puffed up to the size of a football.

"That's Grumble," sighed Nimo. "He puffs up whenever he's annoyed. Which is always."

The mayor wanted a poster for the Pearlhaven Open Days by tomorrow: the Glow Wall photo, the city's name, the dates, and a small picture of the Deep Engine, all on one page. "And make it look professional," he said, swimming away.

Memoon opened Paint and dropped the photo in. Then she tried to type the title on top. The letters went straight onto the photo. When she wanted to move them a little to the left, she couldn't: they had become part of the picture. She tried to paste the Engine picture into the corner, and its white background covered half the Glow Wall.

"Everything I add gets glued down," she groaned. "How do real designers do this?"

Pip looked at her over the top of her notebook. "They don't put everything on one sheet," she said. "They use layers."

💡 Learn With Memoon

Two kinds of digital image. In Chapter 4 you learned that photos are stored as grids of pixels. There is a second way to store pictures.

Raster (bitmap) graphicsVector graphics
Made ofA grid of coloured pixelsShapes described by maths: points, lines, curves and fills
Best forPhotos and detailed paintingsLogos, icons, diagrams, fonts, maps
When enlargedBecomes blurry and blocky (pixelation)Stays perfectly sharp at any size
File formatsJPG, PNG, GIF, BMPSVG, and the shapes inside PDF files
SoftwarePaint, Photos, Photoshop, GIMPInkscape, Adobe Illustrator, PowerPoint shapes

The text on your screen right now is drawn from vector fonts, which is why it stays sharp when you zoom in. Your turtle drawings in Chapter 9 were vector-like instructions (go forward 100, turn 90) that the computer turned into pixels on the screen.

Basic photo edits.

EditWhat it doesWatch out for
CropCuts off the edges to keep only the part you wantYou cannot get cropped parts back once saved, so keep the original
ResizeMakes the whole image bigger or smallerKeep the aspect ratio (width compared with height) locked, or people become tall and thin; making an image much bigger causes pixelation
Rotate and flipTurns the image or mirrors itFlipping a photo with writing in it makes the writing backwards
Brightness and contrastLighter or darker; more or less difference between light and dark areasToo much makes the picture look washed out or harsh
SaturationHow strong the colours areToo much looks unnatural

Destructive and non-destructive editing. Painting straight onto a photo is destructive editing: the original pixels are replaced, and once you save, they are gone. Non-destructive editing keeps the original safe and puts changes separately, so they can be adjusted or removed later. The most important tool for non-destructive editing is layers. Whichever way you work, always keep a copy of the original image.

What are layers? Imagine making a poster by stacking clear plastic sheets on top of a photo. On one sheet you write the title. On another you stick a small picture. Each sheet can be moved, changed or removed without touching the others. Where a sheet is clear, you see through it to the sheets below.

Digital layers work exactly the same way. A layered image is a stack of separate images on top of each other:

  1. Text layer (top): "Pearlhaven Open Days"
  2. Engine picture layer: a small picture with its background removed
  3. Photo layer (bottom): the Glow Wall

The areas of a layer that have nothing on them are transparent. In most editing programs, transparency is shown as a grey and white checkerboard pattern.

Layer skillWhat it means
Add a layerCreate a new, empty, transparent layer to work on
Layer orderLayers higher in the list appear in front of lower ones; drag to reorder
Hide or showTurn a layer's visibility off to check something, without deleting it
Select the active layerYou only draw on, or change, the layer that is selected; most "my drawing disappeared" problems come from drawing on the wrong layer
DuplicateMake a copy of a layer, a safe way to experiment
MergeJoin a layer with the one below it into one layer
FlattenMerge all the layers into a single image

Professional programs such as Adobe Photoshop and the free GIMP and Krita also let you change a layer's opacity (how see-through it is), add special effects to a layer, and save layered files to keep editing later. Windows 11 Paint has the essential layer tools, which are all you need to learn the idea.

Layers in Windows 11 Paint.

  1. Open your photo in Paint (File → Open).
  2. Click the Layers button in the toolbar (it looks like a stack of squares). The Layers panel opens on the right, showing your photo as the first layer.
  3. Click + (Add layer) at the top of the panel. A new transparent layer appears above the photo, and it is now selected.
  4. Draw or add text on the new layer. Only that layer changes.
  1. Point at a layer in the panel and click its menu (or right-click it) to find Hide layer, Duplicate layer, Merge down and Delete layer.
  2. Drag a layer up or down in the panel to change the order.

Removing a background. A picture with a plain white background will hide what is behind it. Paint can remove the background automatically: select the layer with the picture and click Remove background in the Image section of the toolbar. The background becomes transparent. Paint uses AI to decide which part is the main subject, so check the edges carefully: it sometimes cuts off a fin or leaves a bit of background behind.

Saving. When you save as PNG or JPG, the layers are combined into one flat picture. Only PNG keeps transparent areas; JPG fills them in. So save your finished poster as PNG if it has transparency, and keep the project open, or save a separate copy, while you are still making changes.

Selections. The Select tool lets you choose part of an image: a rectangle, or any shape with Free-form selection. Then you can copy, cut, move, resize or delete just that part. Paint also has Select all, Invert selection (select everything except what you chose) and Crop to selection.

Adjusting photos. Paint does not have brightness controls, but the Windows 11 Photos app does. Open the photo in Photos, click Edit image (or press Ctrl + E), and choose Adjustment to change brightness, contrast, exposure, saturation and more. Photos saves the edited picture as a copy if you choose Save as copy, so your original stays safe.

Design principles for posters. A poster has a few seconds to catch someone's eye. Four principles help:

PrincipleMeaningOn a poster
ContrastMake different things look clearly differentLight text on a dark background; a big title and small details
AlignmentLine things up along invisible linesText left-aligned or centred, not scattered
RepetitionReuse colours, fonts and shapesTwo fonts at most; a colour scheme of two or three colours
ProximityPut related items close togetherDate, time and place grouped in one block

Give the poster a clear hierarchy: the most important thing (the title) biggest, then the picture, then the details. Leave some empty space so the design can breathe.

Editing honestly. Image editing is powerful, and powerful tools can be used to deceive. Ask yourself:

  • Is it a record of real events? News photos, science images and evidence must not be edited in ways that change what happened. Cropping and brightening are usually fine. Adding or removing people or objects is not.
  • Would it mislead someone? An advert or poster can be designed and decorated, but must not lie about the product or event. Many publications label heavily edited images as "illustration" or "edited".
  • Do I have permission? Never edit a photo of a real person to embarrass, mock or misrepresent them. Ask before you share a photo of someone, edited or not.
  • Is it mine to use? Use your own photos or images you have permission to use (Chapter 13 explains copyright).

Computers can now create convincing fake photos and videos with AI. You will learn how to spot and think about these in Book 7. The habit starts now: be honest with what you make, and sensibly sceptical about what you see.

💡 Memoon’s tip: Name your layers and keep the photo at the bottom. When something goes wrong, hide the layers one by one to find which one is causing the problem. It is debugging, for pictures.

Illustration from Byte by Byte Book 6: Chapter 12 – Image Editing with Layers

✍️ Try It Yourself

Always work on a copy of a photo. Save a copy first and keep the original safe.

Activity 1: Raster or vector? Open Paint and draw a small circle. Zoom in to 800% (bottom right of the window). What do you see at the edge? Now open PowerPoint, insert a circle shape, and zoom in to 400%. What is different? Write down which one is raster and which is vector.

Activity 2: Basic edits.

  1. Choose a photo you have taken (or ask a grown-up for one you may use). Make a copy of it.
  2. Open the copy in Paint. Use Select to draw a rectangle around the most interesting part, then click Crop.
  3. Click Resize and skew (or press Ctrl + W). Choose Percentage, make sure Maintain aspect ratio is ticked, and set it to 50%. Then try unticking it and making the width 150%. What happens? Press Ctrl + Z to undo.
  1. Open the copy in the Photos app, click Edit image, then Adjustment. Change the brightness and contrast. Click Save as copy.

Activity 3: Your first layers.

  1. Open a photo in Paint and open the Layers panel.
  2. Add a new layer. Use the Text tool to write a title on it.
  3. Add another layer and draw a frame or decoration with a brush.
  4. Hide each layer in turn and show it again. Then drag the photo layer to the top. What happens to the other layers? Drag it back to the bottom.
  5. Duplicate the text layer, change the colour of the lower copy to black, and move it slightly down and right. You have made a drop shadow.

Activity 4: Background removal. Draw a simple character or object in Paint on a white background and save it. In a new Paint image with a coloured background, paste your drawing onto a new layer and click Remove background. Check the edges. Did the AI get it right everywhere? Save the result as PNG.

Activity 5: Design a poster. Make a poster for a real or imaginary school event using at least three layers: a background (a photo or a colour), a picture with its background removed, and a text layer with the title, date, time and place. Use the four design principles. Save it as PNG. Then swap posters with a partner and give each other one compliment and one suggestion, using the names of the principles.

Unplugged: Real or edited? Look at adverts in a magazine or newspaper. For each picture, discuss: was it probably edited? How can you tell? Was the editing honest decoration, or could it mislead someone? Is it labelled?

🎉 Memoon Solves It

Memoon started again, this time with layers. The Glow Wall photo went on the bottom layer. In the Photos app she first brightened it on a copy, and suddenly the magenta and gold of the rangoli glowed the way they had on the night.

Then there was Grumble. Pip wanted to paint over him. Memoon hesitated. "This poster is an advert, so we can design it," she said. "But if you put the photo in The Memunic Times, it has to be the real photo, pufferfish and all. That's what really happened." Pip thought about it, and agreed: the newspaper would print the original, and the poster would say Poster design: Pearlhaven. Memoon cropped the photo so the Glow Wall filled the frame, which removed most of Grumble without painting anything.

On a second layer she added the picture of the Deep Engine and removed its white background. On a third she placed the title, Pearlhaven Open Days, in big white letters with a black drop-shadow layer underneath, and grouped the date, time and place together at the bottom.

Then Grumble himself swam up, puffed and furious. "You cut me out!" he spluttered.

Memoon had an idea. "Would you like to be on the poster properly?" she asked. "Your own layer. Our official mascot." Grumble deflated slightly in surprise. He agreed, with conditions. So Memoon photographed him, removed the background and put him on his own layer in the corner, wearing a party hat drawn on the layer above. It was the first time anyone in Pearlhaven had seen him smile.

The posters went up in every village. But that night, as Memoon was packing up, the Speaking Stone flickered. A strange message crawled across it, and then another, and another, faster and faster. Above them, out in the dark sea, the lighthouses began to flash in patterns no one had ever programmed.

❓ Check Your Knowledge

  1. What is the difference between raster and vector graphics? Give one example of where each is best.
  2. Why does a small photo look blocky when you make it much bigger?
  3. What does "maintain aspect ratio" mean when resizing, and why does it matter?
  4. Explain destructive and non-destructive editing.
  5. What is a layer? Why is working with layers better than drawing everything on one image?
  6. In a stack of layers, which layer appears in front?
  7. How is transparency usually shown in image editing programs?
  8. You draw on your image but nothing seems to change. What is the most likely reason?
  9. Which file format should you save in to keep transparent areas: PNG or JPG?
  10. Name the four design principles and give a poster example of each.
  11. A news website removes a protester from a photo of a public event. Is this honest editing? Explain.
  12. Challenge: Plan a three-layer image of a magazine cover for your favourite hobby. List each layer from bottom to top, what is on it, and which areas are

transparent. Then explain how you would make the title stand out using contrast.

📚 Word Bank

  • Raster graphics: images made of a grid of pixels.
  • Vector graphics: images made of shapes described by maths, which stay sharp at any size.
  • Pixelation: blurry or blocky squares that appear when a raster image is enlarged too much.
  • SVG: Scalable Vector Graphics, a vector image format used on the web.
  • Crop: cut away the edges of an image.
  • Resize: change the size of the whole image.
  • Aspect ratio: the relationship between an image's width and height.
  • Brightness: how light or dark an image is.
  • Contrast: the difference between light and dark areas.
  • Saturation: how strong or intense the colours are.
  • Destructive editing: editing that permanently changes the original pixels.
  • Non-destructive editing: editing that keeps the original unchanged so changes can be undone later.
  • Layer: one of a stack of separate images that combine to make a picture.
  • Transparency: areas of a layer that are see-through.
  • Opacity: how solid (not see-through) a layer is.
  • Merge: combine a layer with the one below it.
  • Flatten: combine all layers into one image.
  • Selection: a chosen part of an image that can be changed on its own.
  • Background removal: making the background of a picture transparent, leaving the main subject.
  • Visual hierarchy: arranging a design so the most important information stands out first.

Keep learning with Byte by Byte

Explore Book 6: Python, Data and How Computers Work. Find the ebook, purchase details and teaching slides on MemuniCity.

Watch this chapter on YouTube

Comments

Popular posts from this blog

CA-7 Job Status and Failure Reason Codes

Here are the various status codes that You may see for jobs in the Queue or Logs in CA-7. R-C0002 R-C0003 R-C0099 R-C0255 R-JCLER A-U0002 A-U0004 A-U0015 A-U0043 A-U4095 A-SOC7 A-U4000 Reason Code/Job Status Code explanation: The indication of the job's current disposition. Values and their meanings are: A-Snnnn-- The job has failed with a system abend. A-Unnnn --The job has failed with a user abend. C-Cnnnn --The job has completed successfully and is going through completion processing. E-ARFATT-- An error occurred during the attempt to attach ARF definitions. This can result if the ARFSET specified is not defined. A diagnostic message may have been written to the CA-7 log, the OS console, or to the trailer queue for the job (in which case it can be displayed using LQ,JOB=x,LIST=ALL). E-ARFERR ---The job encountered an error in the ARF processing. Do a LARFQ command for the job to get more specific information. E-SEGERR --The job has been requeued...

Whistling Winds and Waterfalls: 4 Days of Magic in Shillong

Nestled in the clouds, where the scent of pine trees mingles with the rhythm of waterfalls and the tunes of local guitar-strumming youth—Shillong is more than a place. It’s a vibe. If you’ve got 3 nights and 4 days, you’ve got just enough time to fall in love. Here’s how to make the most of it—food, fun, fog and fantastic views included. Day 1: Shillong, We’re Coming for You! You land in Guwahati, barely out of the airport when the hills start calling. You hop into your cab, Spotify on, windows down, and the three-hour ride to Shillong begins. Just when you think it can’t get better, you stop at Umiam Lake —a lake so calm, it looks like someone ironed the water. By evening, you’re sipping hot chai in Laitumkhrah, maybe nibbling on spicy momos or pork jadoh from a roadside stall. You’re checked into your charming hotel ( Tripura Castle if you fancy old-world royalty, Ri Kynjai if you’re into lakeside poetry). The breeze whispers secrets of waterfalls and pine forests. Sleep well, drea...

Installing and Configuring Hadoop on Ubuntu as a Pseudo Distributed Single Node Cluster

Briefly what is psuedo-distributed single node Hadoop cluster: It is a Hadoop distributed cluster having Single Node. All the five daemons (NN,DN,JT,TT,SNN) are running as individual JVM (java process) instances. We will get all distributed features of Hadoop. This mode is used to develop, test, and staging (before production) Map Reduce programs quickly. It writes all the system, daemon and user logs to different files on the cluster To install Hadoop in this mode, we have to modify the hadoop-env.sh, core-site.xml, hdfs-site.xml, mapred-site.xml. hadoop-env.sh contains all the Environment variables which are required for running Hadoop. All the default values are fine, Only we have to modify the JAVA_HOME=“The location of Java Home Directory” Core-site.xml contains all the cluster specific information like io, temp directory, sorting, file system uri etc. Hdfs-site.xml contains all the parameters which are specific to HDFS like name node directory, data node directory...