15.1. Using Decisions with Images

Learning Objectives:

We can create image effects by conditionally executing code. In the code below we will try to change the color of the women’s shirt. We will clear the red value (set it to 0) for any pixel that has a red value greater than 200 and a green value of less than 100 and a blue value of less than 100.

What happens if we only test if red is greater than 200? Change the code above to try it.

Can you find values that work well to only change the shirt color and not anything else?

Remember that white light is a combination of red, green, and blue light with each value at 255 for totally white light. Try to change just the white background to green.


Discuss topics in this section with classmates.

Show Comments
You have attempted of activities on this page