Try doing chromakey in a range. The picture statue-tower.jpg has a blue, but not blue enough background
Question:
Try doing chromakey in a range. The picture “statue-tower.jpg” has a blue, but not blue enough background to work with chromakeyBlue. However, if you change the rule to getRed(px) + getGreen(px) < getBlue(px)+100, it works great for the sky—but messes up near the ground.
• Change chromakeyBlue to use the modified rule, and apply it to “statuetower. jpg.”
• Now, write chromakeyBlueAbove to take in an input picture, a new background, and a number. The number is a y value, and you should only do chromakey to pixels above that input y. Apply it to “statue-tower.jpg” so that the blue of the sky gets changed to the moon or the jungle, but the area near the ground is not touched.
Step by Step Answer:
Introduction To Computing And Programming In Python A Multimedia Approach
ISBN: 9780134025544
4th Edition
Authors: Mark J. Guzdial, Barbara Ericson