• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Convert binary to image

  • Thread starter Thread starter Member2047631
  • Start date Start date
All digital data is binary, including files like jpegs, pngs, pdfs. Even "plain text" on a computer is stored as 1s and 0s. So converting an "image" to "binary" just means converting data stored in one format into another. So the real question is what is the format of the file you wish to decode? Even if it's just a bitmap (number of rows, number of columns, colour information for each pixel) that's a format (and you'd still need to know how the colour information was encoded, how the pixels were ordered within the file).

If you know what tool created the files in the first place it will be much easier for people to suggest an answer. Otherwise I'd be inclined to just try with some very general image viewing or editing tools and see whether you can find one that can read it.
 
Well on some websites it is like converting an image to binary, and I wanted to do the opposite. I don't really understand what you mean, but yes I know that all computer based things are in binary
 
Well that's what I mean really, "binary" could mean anything at all, so there can't be a universal conversion from binary to some standard image format.

Do you have some specific files you want to convert, or was it just a general question? If it was a general question I wonder what format these other sites are converting to? It might be a standard bitmap format that they are just referring to as "binary" - that might make sense to me.
 
You mean like this?

enzozo-623x410.jpg
 
But unless those 1s and 0s are already encoding an image that's going to be difficult. And if they do, then any app that's displaying them has to know how the image was encoded.

To illustrate, let's consider the simplest possible way of storing an image as binary data: 2 numbers, denoting the number of rows and the number of columns, followed by a string of RGB codes (one for each pixel). That would be a binary bitmap. But a program that's reading and displaying/converting this still needs to know that there were 2 numbers at the start (and how many bits were used for each number), what those mean, and the format of those RGB codes (how many bits per colour value, what order they are in: 8 bits per colour, ordered Red Green Blue, is standard, but it's still a choice to use that rather than say 12 bits per colour or a Cyan Magenta Yellow colour description). So just given a string of 1s and 0s you have to know how they were encoded in order to decode them.

(Though it might be amusing as an art project to just try interpreting say the Microsoft Office executables as images ;). But since they don't encode an image what you would get would depend on the choices you made when translating them).
 
No, I want to convert 1s and 0s to become an image

It's an odd request, because as already stated, a specific application will create and store a binary encoded file, such as an image. You can't simply force an arbitrary collection of binary digits to become an image.
Why do you think you need to do this?
 
I just mean like typing in 1s and 0s and then it being turned into an image based on which order you typed ones and zeros
 
I don't think I need to, I'm just kind of bored and I think it'll be fun... Sorry
 
You can slap me. I'm sorry for annoying you and taking time out of your day.... 😞
 
Nobody's annoyed, we're just trying to understand more about what you're asking for, and why.
I guess the simplest type of image is a bitmap. That is literally a grid of pixels where the value is 0 or 1, as used in early computer games to form sprites. But more complex images like PNG or JPG involve a more sophisticated encoding format. You have to know that in order to construct an image from nothing. It's possible I suppose.
 
You should at least try opening up an image file using just a text editor to see what its internal code consists of. What you're asking is a monumentally involved task, essentially reverse engineering an image file. Writing dozens of strings of binary code that will actually result in an viewable image file is not going to be easy in any way.
 
Ok, maybe this will explain it better because you seem to be confused, so a normal image, you would type in 1s or 0s and it would generate and image based on what order they're in. Like this but reversed:
 
1000000011111111111111100011111111110111
0000000001111111111111100011111111111111
0100000000111111111111100011111111010010
1000000000111111111111100011111111011111
0001000000111111111111100011111110011111
0000000000111111011111100011111110100000
0000000000111110011111100011111110000000
0000000000011110011111100011111111100000
0000000000011110011111100011111111000000
0000000000011110011111100011111111000000
0000000000011111011111100011111111000000
0000001000011111011111100011111111100011
1100000000011111011111100011111111111111
0000000000001100000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000000000000
0000000000011111111111100000111111111111
0000000000011111111111100000111111111111
0000000000011111111111100000111111111100
0000000000111111111111100000011111111110
0000000001111111111111100000011111111000
0000000111111111111111100000001111110000
0000001110011101111111100000011111111100
 
I don't know if that's actually binary, but I used a tool online
 
1111111000000000000001111111111111111111
1111111101000000000001111111111111111111
1111111100000000001011111111111111111111
1111111100000000000111111111111111111111
1111111110000000000011111111111111111111
1101111110000000000000111111111111111111
1111111110000000000000111111111111111111
1111111111000000000000111111111111111111
1111111111000000000000000011111111111111
1011111111000000000000000001111111111111
0001101110000000000000110111111111111111
1010101110000000000000000111111111100111
0100000000000000000000011111111111111111
0000000000000000000000001111100000001111
1110000000000000000000001111111111111111
0000000000000000000000001111111111111111
0000000000000000000000000111111111111111
0000000000000000000000011001111111111111
0000000000000000000000011111111111111111
0000000000000000000000001111111111111111
0110000000000000000000110101111111111111
1110010000000000000001110001011111111111
1101100000000000000011000111000001011101
1111000000000000000000000000000000011110
1011000000000000000000000010101110011111
0001100000000000000000000000001111011000
1001100000000000000000000000001111000000
1111010000000000000000000000001001000000
1110000000000000000000000000111001110000
1000001000000000000000000000110010001110
 
0000000000000110000000000000000000000000
0000000000000000000000000000000000000000
0000000000000000000000000000000110000000
0000000000000001011110000000000110000000
0000000000000000000111100100000000000000
0000000000000000000000110100010001001101
0000000000000000000000001011111111111111
1100000000000000000000000001111111111111
0000000000000000000000000000111111111111
0000000000000000000000000000001111111111
0000000000000000000000000000001111111111
0000000000000000000000000000001111111111
0100000000000000000000000000001111111111
0000000000000000000000000000001111111111
0000000000000000000000000000001111111111
0000000000000000000000000000001111111111
0000000000000000000000000000001111111111
0000000000000000000000011000111111111111
0000000000000000000000111100111111111111
0000000000000000000000000000011111111111
0000000000000000000000000000111111111111
0000000000000000000000000000111111111111
0000000000000000000000000001111111111111
0000000000000000000000000011111111111111
0000000000000000000000000111111111111111
0000000000000000000000001111111111111111
0000000000000000000000111111111111111111
0000000000000000000000111111111111111111
0000000000000000000000111111111111111111
0000000000000000000000111111111111111111
0000000000000000000000111101111111111110
0000000000000000000001111111111111111111
0000000000000000000001111111111111111111
0000000000000000000001111111111111111111
0000000000000000000001111111111111111111
0000000000000000000001111111111111111111
0000000000000000000011111111111111111111
0000000000000000000011111111111111111111
0000000000000000000011011111111111111111
 
Because you can convert something like 000010 (not actual thing) and it would become for example an exclamation mark or something, so if you typed 10101010100101010101001010101001010101010100101 and then converted it to an image
 
Ah, so what you meant was something quite different: you wanted to take a grid of characters and turn it into an image. I think we were all interpreting "1s and 0s" as bits rather than characters, which is what "binary file" implies to anyone who works in or with IT (which I know many of the respondents here do). .

I'm afraid I've not met anything like that. Possible in principle, e.g. turn every 1 into a white pixel and 0 into a black one, but that would give you a very small image (think how long a line of 80 characters is, but how small an 80x80 pixel image is on your screen). My guess is that there isn't much demand for that.
 
Yeah, usually I post things that I can't find or things that others might know about that I don't.
 
But unfortunately a lot of the things aren't completely answered or are impossible 🙁
 
Welcome to Android Forums, Ian Simson!
Can anyone help me out with some files ive found and converted etc?
Perhaps. But first we need to know what kind of files they are, how you converted them, what you converted them to, and what you need help with.

Is this somehow related to Chrome?

In the future, instead of adding your question to an old thread about a different issue, you're more likely to get good help by posting a new thread in the appropriate sub-forum.
 
Back
Top Bottom