Jump to content

Making every image possible


ToukieToucan

Recommended Posts

Hello there!

A while a go a friend and I started a project in which we had the idea to make every combination of pixels so it would form one mega picture.

This sounds very vague and impossible perhaps but something similar happened to [URL]https://libraryofbabel.info/[/URL]

"[I]The universe (which others call the Library) is composed of an indefinite, perhaps infinite number of hexagonal galleries…The arrangement of the galleries is always the same: Twenty bookshelves, five to each side, line four of the hexagon's six sides…each bookshelf holds thirty-two books identical in format; each book contains four hundred ten pages; each page, forty lines; each line, approximately eighty black letters."[/I]

With this lay out there are an near infinite (or so it seems) amount of possible sentences. I had a similar idea: Replace letters with pixels and pages/books with images.

Now since I know there will be a lot of problems and challenges to face I thought it would be good to start off small:
[SIZE=4][B][I]
Goals:[/I][/B][/SIZE]

[U]Colours and basic scale
[/U]
Computer generate all combinations with:


10x10 pixels with 2 colours: black and white
[IMG]https://upload.wikimedia.org/wikipedia/commons/6/66/Bilevel_1bit_palette.png[/IMG]
50x50 pixels with 2 colours: black and white


10x10 pixels with 4 colours: black, dark grey, light grey and white
[IMG]https://upload.wikimedia.org/wikipedia/commons/3/35/Grayscale_2bit_palette.png[/IMG]
50x50 pixels with 4 colours: black, dark grey, light grey and white


10x10 pixels with 8 colours: black, blue, green, cyan, red, pink, yellow and white
[IMG]https://upload.wikimedia.org/wikipedia/commons/e/ed/RGB_3bits_palette.png[/IMG]
50x50 pixels with 8 colours: black, blue, green, cyan, red, pink, yellow and white

[SIZE=3]Ultimate colour/size goal:

24 bit, 250x250 pixels
[/SIZE]
[U]
Search and generation
[/U]
Using an algorithm to generate pixels, must be reversible so you can search from 'shelve' to 'page of a book' and the other way around of course.

Make a program that generates pixels in the above algorithm

Maybe use and (X, Y) coordination system(?):
[LIST]
[*]each pixel is a point
[*]each image is a point
[*]each section is a point
[/LIST]

Make a 'super picture' one big picture with all the pictures in it. The super picture and sub pictures could count as separate pictures[IMG]http://i57.tinypic.com/28v7nkh.jpg[/IMG]
though this would take a lot of clicking if your picture is in the 5000th layer, perhaps making layers of 100 tiles (instead of the above 4 tiles on a layer)

[SIZE=3]Ultimate search and algorithm goal:

Easy to use search engine and reversible algorithm (which yields the same results every time)[/SIZE]
[U]
Finishing

[/U]
Making the actual site (easier said than done)


[SIZE=3]Ultimate Finalizing goal:

Making a slick looking site which functions well

[B][SIZE=4]
Ultimate Main goal:

Making a site which is able to generate every image and will yield the same result every time, and an easy to use user interface.[/SIZE][/B][/SIZE]


All tips and criticism is welcome (as long as you tell what is right or wrong, not just 'bad idea')
Link to comment
Share on other sites

[quote name='ToukieToucan']Hello there!

A while a go a friend and I started a project in which we had the idea to make every combination of pixels so it would form one mega picture.

This sounds very vague and impossible perhaps but something similar happened to [URL]https://libraryofbabel.info/[/URL]

"[I]The universe (which others call the Library) is composed of an indefinite, perhaps infinite number of hexagonal galleries…The arrangement of the galleries is always the same: Twenty bookshelves, five to each side, line four of the hexagon's six sides…each bookshelf holds thirty-two books identical in format; each book contains four hundred ten pages; each page, forty lines; each line, approximately eighty black letters."[/I]

With this lay out there are an near infinite (or so it seems) amount of possible sentences. I had a similar idea: Replace letters with pixels and pages/books with images.

Now since I know there will be a lot of problems and challenges to face I thought it would be good to start off small:
[SIZE=4][B][I]
Goals:[/I][/B][/SIZE]

[U]Colours and basic scale
[/U]
Computer generate all combinations with:


10x10 pixels with 2 colours: black and white
[URL]https://upload.wikimedia.org/wikipedia/commons/6/66/Bilevel_1bit_palette.png[/URL]
50x50 pixels with 2 colours: black and white


10x10 pixels with 4 colours: black, dark grey, light grey and white
[URL]https://upload.wikimedia.org/wikipedia/commons/3/35/Grayscale_2bit_palette.png[/URL]
50x50 pixels with 4 colours: black, dark grey, light grey and white


10x10 pixels with 8 colours: black, blue, green, cyan, red, pink, yellow and white
[URL]https://upload.wikimedia.org/wikipedia/commons/e/ed/RGB_3bits_palette.png[/URL]
50x50 pixels with 8 colours: black, blue, green, cyan, red, pink, yellow and white

[SIZE=3]Ultimate colour/size goal:

24 bit, 250x250 pixels
[/SIZE]
[U]
Search and generation
[/U]
Using an algorithm to generate pixels, must be reversible so you can search from 'shelve' to 'page of a book' and the other way around of course.

Make a program that generates pixels in the above algorithm

Maybe use and (X, Y) coordination system(?):
[LIST]
[*]each pixel is a point
[*]each image is a point
[*]each section is a point
[/LIST]

Make a 'super picture' one big picture with all the pictures in it. The super picture and sub pictures could count as separate pictures[URL]http://i57.tinypic.com/28v7nkh.jpg[/URL]
though this would take a lot of clicking if your picture is in the 5000th layer, perhaps making layers of 100 tiles (instead of the above 4 tiles on a layer)

[SIZE=3]Ultimate search and algorithm goal:

Easy to use search engine and reversible algorithm (which yields the same results every time)[/SIZE]
[U]
Finishing

[/U]
Making the actual site (easier said than done)


[SIZE=3]Ultimate Finalizing goal:

Making a slick looking site which functions well

[B][SIZE=4]
Ultimate Main goal:

Making a site which is able to generate every image and will yield the same result every time, and an easy to use user interface.[/SIZE][/B][/SIZE]


All tips and criticism is welcome (as long as you tell what is right or wrong, not just 'bad idea')[/QUOTE]
You have too much time on your hand.
Link to comment
Share on other sites

In principle you only need one thing: an invertible hash function. Then you use that function and interpret the output as a bitmap. One such function is to just take the index of the string in a lexicon, ordered lexicographically. Or easier to implement: interpret it as a Base36, Base64 or whatever_such_thing number and use that. Cryptography will give you many more that are not easily reverted.

But in reality this will lead to all pictures being very very boring (emptyness and/or noise). Such as the pages from your link: purely random gibberish.
Link to comment
Share on other sites

[quote name='ZetaX']In principle you only need one thing: an invertible hash function. Then you use that function and interpret the output as a bitmap. One such function is to just take the index of the string in a lexicon, ordered lexicographically. Or easier to implement: interpret it as a Base36, Base64 or whatever_such_thing number and use that. Cryptography will give you many more that are not easily reverted.

But in reality this will lead to all pictures being very very boring (emptyness and/or noise). Such as the pages from your link: purely random gibberish.[/QUOTE]

Thanks that looks very interesting (and helpful) though I'll need to look up what all those terms mean (okay, I looked the terms up but still don't really get all those terms, I would appriciate it if you could explain them a bit less technical since I know basicly nothing about computer science) . About the second part: I do understand that there will be a lot of noise but if you were to find a "real" image (what would define a real image? Something that looks like an easily recognizable object or just a general shape? I guess you could say the noise is just as real as an image of a nice vase since they were both generated and that there was no specific intention of making 'that' image) then it would feel like you've found a treasure.

But yes noise is also part of the I guess you could call it an artwork. Edited by ToukieToucan
Link to comment
Share on other sites

Well, I'm not a programmer (just a doctor), but your basic concept seems correct. From my experience with java, I'd advise you to give each colour a number code like this:

[CODE]
int Black = 1;
int White = 0;
int Red = 2;
int Blue = 3;
int Green = 4;
.
.
.
[/code]

Then dump it in an XML?

[code]
<Picture>
<column>
1.0.0.1.0.1.0.1.0.1
</column>
<column>
/* ... */
</column>
</picture>
...
[/code]

In my experience, the XML is much easier to work with than a bitmap, and you can get that bitmap by just making the program read the XML and dump it there. If you want to get the single ints, just use some equivalent of String.split() (In PHP it's explode(), IIRC) and the "matches()" keyword (preg_match in PHP) to get it together.
Hope this helps...
Link to comment
Share on other sites

So, (2[SUP]24[/SUP])*250[SUP]2[/SUP], or 1.048576*10[SUP]12[/SUP] images. Each pixel would need 64 bits to contain its entire information (24 for colour, 8 for X-coord, 8 for Y-coord). There's 62500 pixels, so 64*250[SUP]2[/SUP] bits, or 4000000 bits if you define each pixel individually. That means you could have as many as 4.194304*10[SUP]18[/SUP] bits in total. This'll be ~4Eb, or 500TB. Of course, this is assuming that each pixel has a coordinate, rather than a continual stream of color (and Kraken help you if you miss a bit). Considering that few (if any) hard drives greater than 100TB exist, you'll need at least 6 drives to store your Library. Now, if you had an algorithm, then you could simply get an index number which would generate your image. But the algorithm might be...entertaining to write.
Link to comment
Share on other sites

[quote name='ToukieToucan']Now since I know there will be a lot of problems and challenges to face I thought it would be good to start off small
(...)
(...)
50x50 pixels with 8 colours: black, blue, green, cyan, red, pink, yellow and white
(...)
24 bit, 250x250 pixels
[/QUOTE]

You're joking, right?

1 pixels, 24 bits [I]alone[/I] is already 2[sup]24[/sup] combinations, or equal to 16,777,216 combinations. Then you want to do [I]each[/I] of those 16 million combinations over a grid of 256 * 256 (let's round up to the nearest power of two) pixels or 2[sup]16[/sup] pixels in total (65,536). Now, [I]each[/I] of those pixels can have those 16 million combinations, so you get a total of (2[sup]24[/sup])[sup]2[sup]16[/sup][/sup] combinations. That's... a lot.
Link to comment
Share on other sites

[quote name='K^2']You do realize that people who have made that site have already made an image version of it, right?[/QUOTE]

Depends. Do you mean they decode the image for you or you simply feed the random number generator to your image browser. If the later, you could claim they already have a movie version as well.

We had a movie version in the twentieth century. We called it "static" and sometimes saw it on TV. You might still hear the audio parts sometime.
Link to comment
Share on other sites

[quote name='wumpus']Depends. Do you mean they decode the image for you or you simply feed the random number generator to your image browser. If the later, you could claim they already have a movie version as well.

We had a movie version in the twentieth century. We called it "static" and sometimes saw it on TV. You might still hear the audio parts sometime.[/QUOTE]

Very interesting, though the movie/static version would be infinitly bigger than the picture version since every frame will be different (or the same if you're lucky) and say you have 60 frames per second and a 10 second movie you'd have 600 pictures which would all be random.
Link to comment
Share on other sites

[quote name='wumpus']Depends. Do you mean they decode the image for you or you simply feed the random number generator to your image browser.[/QUOTE]
You can provide it with the image, and it will give you a seed that generates it. You can also use random seed, which does, indeed, produce static. But that's exactly the same behavior as the text version.
Link to comment
Share on other sites

Hello ToukieToucan,

Send me a PM with your skype or email address.
I'll gladly spend a few hours helping your out with your project, it's complex but not as much as you think.

PS: Storing the images is a very bad idea, you would need a huge storage. I would simply generate them on the fly from an hash.
Link to comment
Share on other sites

That won't be enough. Pseudo RNGs usually gives a 'random' values in the form of a 32 or 64 bit floating point numbers.

As Kerbart in post #7 wrote correctly there'll be (2[SUP]24[/SUP])[SUP]2[SUP]16[/SUP][/SUP] (~1.55 * 10^231) possible pixel combinations and you need an RNG which can output all of these combinations. But floating point numbers are limited in precision, they can't store that many different values. The computer will round them to the next number it can store in a memory.

You'll need an RNG which works with so-called 'big integers'. Afaik there's none and big integers are [I]slow[/I]. Also the number of combinations are so huge that you'll see patterns in the generated data caused by the design of the RNG algorithm (that's one of the reasons why they are called [I]pseudo[/I] random).

Afaik there're no RNGs which can handle that large numbers. You'll need to come up with your own one.
Link to comment
Share on other sites

[quote name='*Aqua*']You'll need an RNG which works with so-called 'big integers'. Afaik there's none and big integers are [I]slow[/I]. Also the number of combinations are so huge that you'll see patterns in the generated data caused by the design of the RNG algorithm (that's one of the reasons why they are called [I]pseudo[/I] random).[/QUOTE]

That's all wrong. The principles RNGs are based on generalize to arbitrarily high number. See for example the Mersenne twister, but almost any other should do. You might have to find some library or code it yourself (depending on what language you use), though.
For some older ones (quadratic congruential generators and such) you might get patterns, but modern ones are made to avoid those as good as possible. Even if there are patterns, they would only be visible after huge amount of uses, where "huge" is a number much bigger than the number if requests I expect that page to get (or, if done right, higher than the amount of atoms in this planet).

Big integers are a non-issue as well. Naive implmentations (of something like 100 000+ digit numbers) are slow, but we have fast fourier transform-based multiplication and such. But I don't think you would even need that. Take a 1024 bit number, which is very small in comparision to what would already be possible, and you should never encounter a problem. That will be mroe than enough data per picture to work with.

In total, this is just an elaborate version of my first post on this. Edited by ZetaX
Link to comment
Share on other sites

[quote name='*Aqua*']That is already ruled out. You would need 500 TB storage for it.[/QUOTE]

It is 100% impossible to assign a unique integer to every possible image without using at least as much memory as the bitmaps themselves. A bitmap is the smallest generic representation capable of encoding all possible images.

If you're only interested in representing a small subset of all images, it's easily possible to do better and there's various techniques for doing so; just about any lossless compression algorithm will do. However, there is no single algorithm which is guaranteed to encode an arbitrary image using less space than a simple bitmap.

[quote name='*Aqua*']My dictionary doesn't know "absed". What does it mean?[/QUOTE]

It's a typo of "based".
Link to comment
Share on other sites

There is a 'maths trick' that came to be called 'Tuppers self referential formula', that when plotted, apparently appears to draw a picture of itself. But it is actually just a method of decoding a given constant into a bitmap image. given the right constant it would 'draw' any possible picture of a certain size.

If you want to go from a 'number' to a bitmap, just take the bits that represent that number and interperet them as the bits of the bitmap. That is all a bitmap (image made of pixels) is. You will be dissapointed though, most will just look like random noise.
Link to comment
Share on other sites

[quote name='*Aqua*']Wait, are we talking about the same bitmap? I was under the impression that a bitmap image (.bmp) was meant.[/QUOTE]

Yes, that's what I'm referring to.

[quote name='jf0']There is a 'maths trick' that came to be called 'Tuppers self referential formula', that when plotted, apparently appears to draw a picture of itself. But it is actually just a method of decoding a given constant into a bitmap image. given the right constant it would 'draw' any possible picture of a certain size.

If you want to go from a 'number' to a bitmap, just take the bits that represent that number and interperet them as the bits of the bitmap. That is all a bitmap (image made of pixels) is. You will be dissapointed though, most will just look like random noise.[/QUOTE]

Indeed. In fact, any file can be encoded as an integer. We sometimes joke at work that software engineering is just the practice of discovering large integers that happen to do what you want when you execute them as a program.
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...