Skip to content ↓
A head-and-shoulders illustrated portrait of Kayode. He is smiling with his mouth closed, has medium dark skin, and short curly hair. He's wearing a light blue collared shirt.

ms paint sidequest by Kayode D. '27

by kayode and caleb on a monday night

Hallo! 

My friend, Caleb M. ‘27 and I are currently in the MIT Student Center, and we need to be working. 

I’m currently working on an assignment for 2.007, which was due Sunday night at Midnight. I’ll explain more about the class in my next blog, to be posted this week, but this is what work I’ve accomplished tonight: 

I CADed up this piece for my robot in the last hour. I call this “The Finger,” because it’s what I will use to grip and switch a lever back and forth. It’s attached to a beam I’ll call “The Arm”, and a base I’ll call… well I don’t really have a name for that. I’ve just been referring to this robot as “Big Man,” so I guess that’s what I’ll call it. 

Here’s the prototype I built in lab today. It uses two rubber bands to create a one-way door to catch hold onto the levers. Pretty neat!!

I’m not sure what Caleb is supposed to be working on. 

We currently have only one laptop charger and both of our laptops are near dead. 

The Sidequest: 

Yesterday, I made a comment on Ellie’s Fantastic Blog, in which I quickly edited together this image in MS Paint: 

After this, I wondered if it would be possible to make a program that could put any image into this little frame for you. It would be neat if it also lowered the resolution by a bit, and matched the colors to the closest ones in the default ms paint color palette. It might take some time, but this could also be done to a video if done correctly. The more I thought about it, the more I thought it was definitely possible. 

About an hour ago, I told this idea to my friend, Caleb M. ‘27, who is also here. We started talking and he said that it is most definitely possible, and possible in under an hour. 

I’m currently***** taking 6.101, a coding class at MIT. One of our most recent assignments was an image modulation lab, and we did a lot with modifying image pixel colors and locations. It was honestly a really hard lab, but we realized that basically all of the framework needed to make this happen [also, Caleb did really well in that class so he can do all of the coding and i can do all of the blogging :[]  ]

We both stopped working, and since I’ve started writing this blog about our little ms paint sidequest, Caleb has finished modifying the first video!

I chose this one i found by searching for “dancing old man” on google: 

https://www.youtube.com/watch?v=i4FuPdMskeI 

Here’s the output we got: 

It works!! We immediately noticed that it is very desaturated. 

TAKEAWAYS for next time: 

  • Wider color palette
  • Better function for choosing the closest color.
  • More vibrant video

next time:

This time we used a more colorful video:

https://www.youtube.com/watch?v=fzKURp_OJV0

it’s 1:50 now. here’s caleb with the lowdown of what’s goin’ on:

Hi there. So if you’ve taken or are taking 6.101, you may remember the lab Image Processing 2. In that lab, we wrote various functions that allowed us to manipulate images, messing with the colors, applying filters, things like that. Because I didn’t want to write all of this stuff anew, I decided to directly use my lab from 3 semesters ago, which gave me access to a handful of functions to manipulate images. So my thought process was:

1. Divide a video into a series of frames,

2. Edit each frame as an image to match the color scheme of MS Paint using the functions in the lab, and

3. Stich the frames back together in the video.

To do step 1, I used Windows Powershell with an ffmpeg command to split the video into a bunch of frames. Easy. No Exclamation Point, or parentheses for this statement. Sorry. Anyway: In Image Processing 2, we wrote a helper called apply_per_pixel that let us pass in an image and a function to apply to each colored pixel and then would produce a new image with that filter applied. I wanted the filter to choose the closest color from the MS Paint Windows Vista color palette, so I wrote a short helper function that initially compared the sum of the absolute differences between the Red, Green, and Blue values of the pixel at hand to each MS Paint color and return the one with the smallest sum, which I imagined yield the “closest color.” This approach, however, returned us with the first video, where many pixels just became grey. I realized that the simple sum of the differences wasn’t the most effective method to find how close each color was, so I instead replaced this with the Euclidian Distance between the MS Paint Color and the color of the pixel, imagining each color as a 3D Vector: sqrt[[r2-r1]^2 + [b2-b1]^2 + [b2-b1]^2]. This was a much stronger approach that yielded a much more colorful result exclamation point. I then made a loop to read each frame from the folder that I saved them into, apply_per_pixel the helper to choose and apply the closest MS Paint color and construct a new image, and then save that into a new file. Step 2 complete exclamation point. Finally, I returned to my trusty Powershell and ffmpeg to stitch all the frames back together, completing Step 3 and returning our final video [okay and then I used Premiere for the MS Paint frame but whatever that’s not the cool part]. Yeah. I’ve got so much work to do tonight. Caleb out.

 

ok. we did it. here it is:

ok. i’m going to sleep. thank you all of joining us.

toodles.