Q: A user opens a file containing an image of size 640 × 640; the color of each
ID: 3864786 • Letter: Q
Question
Q: A user opens a file containing an image of size 640 × 640; the color of each pixel is
coded on 32 bits. It is assumed that this file is stored on disk in binary format "raw"
uncompressed (no header, no end character line or end of file). The user edits the image
as follows:
• user reduces its size to 286 × 286,
• user makes an image in 256 gray levels (coded 2 byte)
•user "overwrites" the original image by saving the edited picture with the same name.
a. what is the Original File Size?
b. what is the Compressed File Size?
c. what is the total number of blocks that were released?
Explanation / Answer
a.
Given that the original image is of size 640x640.
Then, the total number of pixels in the given image are 640x640 = 409600 pixels.
It's also given that 32-bits are required for each pixels to it's store color information. We know that 32-bits are equal to 4 Bytes. So, therefore total amount of memory required will be
Total Size = (409600 pixels) x (4 bytes/pixel)
= 1638400 bytes
= 1638400/(1024*1024) MB # Converting bytes to MB
= 1.5625 MB
b.
The user compressed the above image to 286x286 pixels and then reduced it to 256 gray level (2 byte code)
Therefore total number of pixels = 286x286 = 81796
Total Size = 81796 pixels * (2 bytes/pixel)
= 163592 bytes
= 163592/1024 KB
= 152.757 KB
c.
The question can be re-phrased as follows : If 1638400 bytes corresponded to 409600 pixels. Then, 163592 bytes corresponds to how many pixels in the original image? What is the decrease in number of pixels in original image?
Total Decrease = 409600 – (163592 * 409600/1638400)
= 4,09,600 – 40,898
= 368,702
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.