Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python code please: Assignment 2 A: Image Color Depth: In Assignment 1 , we learned that each pixel of a computer image is represented with
Python code please:
Assignment A:
Image Color Depth: In Assignment we learned that each pixel of a computer image is
represented with three values, RGB If we add transparency, we would have RGBA A for
alpha channel Traditionally one byte is used for each color, meaning that each pixel takes up
bytes of space. These are known as bits per color channel encoding, or BPC for short. More
recently, encodings with larger ranges of color have become popular with artists and
photographers. Programs like Photoshop now support BPC and BPC encoding.
For this assignment, you will try to determine the encoding of an RGBA image based on its
width, height, and file size. After the user enters this information, you will first check if the
information is valid. If not, you will notify the user and skip to the end of the program.
Hint: You will have to check multiple potential issues with your IF statements
If the detail is valid, you will then calculate the BPC encoding. Based on the value, you will use a
Switch statement to print out if the image is or BPC If it is outside the range, inform
the user that your computer does not know how to read this encoding.
You must save the code in a file called
AssignmentApy
Sample output #:
Image Encoding Checker
What is the image width?
What is the image height?
What is the file size in bytes
The information is invalid please reenter it
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started