Real pixel coding (2011)
iquilezles.org
iquilezles.org
The program would be written in assembly, converted by hand to hex and then each hex byte found in the character map and typed in. It was then possible to CALL the start of screen memory to run the program.
At one job we had a machine code ring buffer implementation that could be called via a software interrupt (INT 3 I believe with a single character in AL) to write a single byte of debug information. This could be used when tracing a program's execution. When the program crashed the ring buffer could be examined using a system debugger (typically Soft-ICE) to see what state it was in. Very useful when it was critical to get tracing information in a way that had minimal timing impact.
I once knew a guy who had programmed by drilling holes in leather with a hand drill. :-)
[Some ancient process control mainframe that booted originally from a paper tape - over the decades of use in a steel mill the paper tape had long since worn out and been replaced by a sturdy leather belt - he had to modify the boot code, hence the drill]
where the source code are images similar to works of Piet Mondrian.
And there's ColorForth where the colors replace some of the punctuation normally used in Forth: http://www.colorforth.com/cf.htm -- this (seems?) more serious.
Not to downplay it here, I'm just describing what's going on. This is basically a small nice looking demo.
copy CON: reboot.com
and then enter 8 or 9 bytes (some via ALT+keypad) all from memory.
(There are ways to do it in just 2 bytes I believe, this isn't about reboot.com golf anyway...)
Now I want to see how all my programs look as bitmapped images... brb.
Hmm, curious if this visualization would actually work to spot duplicated code.
so that means DRY is "try to maximise entropy" gzipped files should also look like random noise, for the same reasons.
This sounds so wrong. This sentence makes it sound as if any 3 minutes HD video has smaller filesize than a 32x32 pixel icon. Of course people won't believe you if you use that wording.
I assume what you mean to say is, it is possible to create SOME 3 minute video with music that is smaller than SOME 32x32 pixel icon.
E.g. if you store the 32x32 pixel icon in some XML format that describes every single pixel color component, and the video is plain white with some bleep music :p
If he's having trouble explaining it to people, it's because he's not wording it correctly. And if he's wording it correctly he should use the same, correct, understandable wording to tell us.
The point is pretty cool though, algorithmic compression is pretty awesome, especially when you don't have to conform to any particular end result. A fresh Minecraft world is a 240k jar file used as a decompression tool, and the data is a single integer (the seed). In the end the result is some 9 million times the surface area of the Earth.
However, start modifying that world and the data needed to store it balloons. Make a world that accurately mimics the surface of just Iceland and you're going to be looking at a pretty large file.
Accept a world that's a bit of simplex noise and Brownian motion and let yourself be awed. Make a video of rotating around a fractal made from a simple formula - that looks cool. Try and compress a video of your daughter's first steps and you'll get something significantly larger than an icon. Especially an icon that's at least run-length encoded.
https://www.youtube.com/watch?v=36BPql6Nl_U
That's 128 bytes. You could encode that as a 43 pixel RGB888 image. That's less than 7x7 pixel icon!
Now as Jare mentioned in another comment, this video
http://www.youtube.com/watch?v=jB0vBmiTr6o
contains less bytes than a basic 32-bit 32x32 pixel icon. Some of the whole essence of this demoscene stuff is to work within these constraints(256 bytes, 1024 bytes, 4096 bytes, 64 kbytes, ...) to produce this kind of art. Custom virtual machines, on-fly decompression algorithms and methods, carefully crafted data and ingenious ways of data re-use are the key. It's like black magic.
But granted, initially I assumed the article would be about that, but the colours give it away that it's not. Well, that, and the description of what he's doing.
Don't forget checking his productions with RGBA! http://pouet.net/groups.php?which=697
For example (this is 16 bit but for the sake of demonstration) byte A1 (10100001) means ADD AX, BX. 101(add)00(ax)001(bx).
[Edit]
Found a cool image showing x86 opcodes. http://i.imgur.com/69Lli.png
And even a cooler one with windows exe description (not DOS .com as he used) http://i.imgur.com/tnUca.jpg Look at the right side of the image where it sais x86 Assembly where it colors and explains each byte. His .com was only that part since .com didn't need headers and imports and it was just code.
echo "main(i){for(i=0;;i++)putchar(((i*(i>>8|i>>9)&46&i>>8))^(i&i>>13|i>>6));}" | gcc -x c - && ./a.out | aplay
The generated a.out is 8.5kB for me though.(although, I will now spend a good few hours working out how on earth you get the 16 bar repeats, with variations, and indeed the kick, from some crazy bitshift magic.)
Am I wrong?
See, to me this means "reading the colors from the printout". It's ridiculous that anyone could get the least significant bits of the color right by just eyeballing it, and I don't think the author ever claimed he was doing that.
If you look at the video carefully, you'll see that the color picker displays numeric RGB values and that it has been sped up. Do you think the code would work if he didn't get the values 100% right?
Off to the right side of the screen (not visible) is probably another image with the colours in that he's picking from.
Maybe it's fake but it's theoretically possible. I don't have a windows pc to try on. He's provided the image though so you could try for yourself.
it takes less space to write a 3 minutes HD animated video and music clip than than it takes to store a 32×32 pixel icon
The video very clearly demonstrated that using only a 9x9x24bit image you can encode a program that, when executed, will produce many MBs of data. It's the same concept as x (k)Bytes of data producing an infinitely scrolling procedurally generated terrain.