Question: 1 5 . Add Image Transposition The function transpose does not have any parameters other than image. Implement this function as specified. It is very
Add Image Transposition
The function transpose does not have any parameters other than image. Implement this function as specified. It is very similar to the function of the same name shown in the videos for the module Programming with Nested Lists. Download this function from the Canvas page if you need a hint.
This function will look like it rotates the image, but its slightly different. It actually rotates and flips. You should test it out on the less symmetrical images. For example, the command
python pictool.py transpose imagesJapanpng Japanpng
should perform the following conversion:
def transposeimage:
Returns True after transposing the image
All plugin functions must return True or False. This function returns True
because it modifies the image. It transposes the image, swaping colums and rows.
Transposing is tricky because you cannot just change the pixel values; you have
to change the size of the image table. A x image becomes a x image.
The easiest way to transpose is to make a transposed copy with the pixels from
the original image. Then remove all the rows in the image and replace it with
the rows from the transposed copy.
Parameter image: The image buffer
Precondition: image is a d table of RGB objects
# Change this to return True when the function is implemented
return False
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
