Question: from CSE 8 AImage import * from pa 5 import * RGB codes for common colors. You can add on to this
from CSEAImage import
from pa import
RGB codes for common colors. You can add on to this
if you want to experiment with different colors.
black
white
red
green
blue
yellow
magenta
gray
purple
def testcomplement:
# TEST CASE :
# Create a image of magenta color and visualize it
testimg createimg magenta
saveimgtestimg "magentatestimgjpg
# View the pixel values of the original image
imgstrtofiletestimg "magentatestimgtxt
# Call complement and visualize the resulting image
result complementtestimg;
saveimgresult "complementresultjpg
# View the pixel values of the filtered image
imgstrtofileresult "viewcomplementpixels.txt
# TEST CASE :
# Load the cat image given and call complement on it
cat loadimgimagescatjpg
img complementcat
saveimgimg "complementcat.jpg
# TEST CASE :
# TODO: Add test case for complement function using a self created image similar to Test Case
def testnegative:
# TEST CASE :
# Create a image of red color and visualize it
testimg createimg red
saveimgtestimg "redtestimgjpg
# View the pixel values of the original image
imgstrtofiletestimg "redtestimgtxt
# Call negative and visualize the resulting image
result negativetestimg;
saveimgresult "negativeresultjpg
# View the pixel values of the filtered image
imgstrtofileresult "viewnegativepixels.txt
# TEST CASE :
# TODO: Add test case that loads the cat image given and calls negative filter on it
# TEST CASE :
# TODO: Add test case for negative function using a self created image similar to Test Case
Calling the Test functions one after the other.
You may want to uncomment one test at a time.
OPTIONAL: You can add tests for the custom filters you have
created as part of Star points.
#testcomplement
#testnegative
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
