Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

please help HW # 4 ue Date: June 27, 2018 (11:55 PM) 1. A person had been sent a

ID: 3908001 • Letter: P

Question

please help

HW # 4 ue Date: June 27, 2018 (11:55 PM) 1. A person had been sent a file in GIF format and saved it as file "image.gif." For a particular application, the person wanted a file in JPEG format. Explain why the following approaches might or might not work. a) Change the name of the file from "image.gif" to "image.jpg." (This approach is not hypothetical I have talked with people who have tried this, but might this approach work?) b) Use an image-processing utility, such as Photoshop, GIMP, or xpaint, to load the file "image.gif" and then use the "save as" feature to produce a new file "image.jpg." (I know people who have tried this approach too-will this approach work?) 2. Explain in your own words what "lossless" and "lossy" mean.

Explanation / Answer

1.

a) Renaming a file with extension gif to jpg doesn't change anything inside the file. All it does is rename the file. The effect of this is interesting.

The operating system is fooled into thinking that the file is infact jpg while it is actually a gif file.

So, if the use case asks for jpg but can handle gif too, then there may not be an issue and it would work. However if the application actually requires a jpg encoded file, then simply renaming it won't work for the above mentioned reasons.

------------

1 (b) Yes, this approach works. The reason is the following:

So the end result is a jpg file with likely a different file size than the gif file.

--------------

2)

Some bits of data are permanently lost. That's why it is called lossy encoding.

Although user may not notice it.

I have given complete solution to your problem. If you have any query, please ask in comments. Thanks.

Lossless Lossy All the bits of data can be recovered during the decoding. That's why such encoding is called as lossless encoding.

Some bits of data are permanently lost. That's why it is called lossy encoding.

Although user may not notice it.

Important data such as finance documents, etc are usually stored in lossless formats because we may risk losing important data. Usually video, audio and images are stored in lossy formats because they are a lot of redundant data and also losing some bits doesn't make the perception any different to the user. Example include gif format. Example is jpg format.