Hi, this is Sarah! Welcome to day 6 of Scratch Art.
Last time, you learned about a conditional called the “if” statement.
Today, you will use another conditional called “if/else” to make a program that scansan image and makes a shadow. An “if” statement reads: if a conditionhappens, then do this action.
An “if/else” statement represents an either/or option. If the first condition is met, thenit will do the first option. If the first condition is not met, or “else” it willdo the second option.
For todays project, the shadow should be black if the picture is black, but otherwise, orelse, something still needs to happen - the shadow should be white. An “if” alonewouldn’t allow for both options.
Pictures displayed on a computer screen are made up of millions of little squares calledpixels. When the human eye takes in all these little squares together, it sees them as onecomplete picture.
Computers make it easy to change the look of a picture or photograph because they canmanipulate each tiny pixel individually. Apps and photo editing tools like Instagram applyspecific digital effects to photos using a process similar to the one you will use today.
Sometimes called filters, these effects include making photos black and white, altering thecolor scheme, or selectively changing portions of a photograph.
Editing tools like Photoshop can reduce redeye, make a background transparent, and sharpenimages. The computer tests each pixel in the photo and changes it to create the different effects.
The if/else conditional statement allows computers to make these effects. In this example, thecomputer applies a “selective color” effect. It scans the color of each pixel. If the colormatches the one it is programmed to to bring out, it keeps that color. Else, it greys outthe color. In this picture, the program keeps the vibrant yellow color, while the othercolors are greyed out.
These editing tools were created with computer science. Before these kinds of tools existed,artists had to painstakingly apply color to film or paint out mistakes. With computers,these corrections can be made instantly. In today’s project, you will program a filterthat scans images to make silhouettes or shadows. Now, it’s your turn. Open the starter project,click remix, and sign in. Then, proceed to the next video.