Weekly Programming III Post 1

This week was the first week of the course Programming III.

To start off this new course we were handed out an assignment to compress a BMP file as much as possible, then restore it to the original BMP file that it was from the beginning. The first thought of this was how do you even?….

Doing this assignnment in a group of 3 persons helped. There was some backseat programming as it was hard to split out the work of one assignment that no one in the group how it was goin to be made. We did however discuss in group of How we should do it in theory and how to compress it even further.image

The bmp file looked like this and was originally 193 kB, we managed to compress it down to 4 kb but did not save that build as we thought we could go further, resulting in corrupting that build and getting it back to our previous 7 kb. This was achieved by bundling each sort of pixel color in a row together in a block that would later be reverted back in the decompressor. We did not manage to get the decompressor working though.

After we had this assignment i started to talk about it with a norwegian friend of mine that also does programming. He decided it was a fun assignment, and he could do it better. Towards the end of the week he had managed to compress it down to 22 bytes. By using search algoritms for each rectangle and doing it over and over trying to link rectangles together. having the picture ending out in 5 rectangles. each having x, y, height, width, color.

At this moment i only have the code for the Decompressor and the compressed file. But what is even more fun with the Decompressor is that it can turn any file into a bmp picture by just dropping that file on the Decompressor exe file. It will not read the whole file, just up to the max cap. This results in funny pictures such as these.

 

out out out