Converting image files into binary code?

  • The masquerade of murder returns! A new game of Vampires Amongst Us has begun. Unmask the killers, trust no one, and try to survive the night. Find out more and sign up now!

TMS

Moderator
Moderator
True Blood
Nov 26, 2008
4,662
Sweden
Zombies
3,992
Hello,

Does anyone here have any experience with converting image files (.jpg's, for example) into binary drawings consisting of ones and zeroes?

Thanks,
MS
 
? Unsure what you're trying to do here. Are you trying to represent an image just using 1's and 0s, or are you storing the information of the picture into binary for later reconstruction...?
 
Ok, so my current suggestion is:

1) Use a program to convert the image to an outline.
2) Convert the image to bitmap.
3) alter the resolution to make it really grainy.
4) Manually fixup any pixels that seem out of place.
 
He he, I was about to offer some sort of advice, before realising just how out of my depth I am.

Damn, in Fallout I have really high Science..... stupid real-life...
 
Count Darvaleth said:
Damn, in Fallout I have really high Science..... stupid real-life...

:lol:

Alright, so I think I've found a method to try. If I use an image manipulation program to produce a black and white trace by hand (simple but time consuming, depending on the size of it) I can then run it through that text-image site. The large white areas will all show as the same letter (or as blank) while the black lines will look different. I'll then take it into Notepad++ and do some extensive Find/Replace With to swap characters around.

I'll try to produce something later today and show you the progress.
 
Success!

Well, kind of anyway. It is a bit thick in places, but that's just due to my failure to prioritise when tracing the image - shouldn't have tried to get every defining characteristic into it. :slapface: It's the image I use as my avatar on here, if you couldn't tell. ;)

The process turned out to be quite different from what I had imagined though. After producing the outlines I had to size it like I wanted it to appear in the game (I chose 400x400 pixels), and then it needed to be taken down to 12.5% or 1/8th of that size to accomodate the bullets that'll form it up, seeing as they're 8 pixels large in-game. I ended up with an image 50x50 in size, which I then had to go through manually, pixel by pixel, and note down either a zero or a one if I wanted a bullet in the pixel or not.

Now I just need to refine my workmanship. :clown:
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu