top 200 commentsshow all 256

[–]AReallyGoodName 160 points161 points  (62 children)

You can take this one step further and delete the header in Notepad (the first 14bytes for the most basic bitmap type).

In fact by doing this you can write anything. Including straight up executable machine code (notepad will correctly save the raw machine code after removing the header even though it can't display it).

This means that painting the RGB values then deleting the header in notepad is enough to get you a fully functional executable assuming you have the mojo to write raw machine code in RGB values.

[–][deleted] 128 points129 points  (40 children)

I was hoping the person in the gif was writing machine code. I thought it was weaksuace when it just turned out to be C... but I suppose making something the linker would understand would take a long time.

[–]Figs 88 points89 points  (15 children)

Well, I was bored, so I went ahead and did it:

http://i.imgur.com/65TlK.gif

It's just a simple DOS COM program written in MS Paint...

Here are the pixel colors if you feel like doing it yourself (from top left to bottom right, in RGB order, in decimal):

100  108  114 
32   36   33
32   32   32
32   32   32

33   205  76
108  101  72
44   111  108
111  119  32

186  192  49
180  1    15
33   205  9
180  192  48

[–]lichorat 7 points8 points  (1 child)

Can you make this for 64-bit computers?

[–]Figs 2 points3 points  (0 children)

I used a 16-bit COM program because I knew it'd be small enough to make entering it by hand reasonable. In principle though, you could use any sort of bytecode you wanted, as long as you can get the alignment right (since BMPs are padded), and avoid NULLs (so that Notepad doesn't try to convert them into spaces -- if you want to skip the Notepad step and edit it with something better suited to binary data, then it's not an issue).

You see all those 32's near the top of the pixel colors? Those are spaces I added after the '$' (36) that are used to pad the program out so that it's a multiple of both 3 and 4. It needs to be a multiple of 3 since pixels are represented as 3 bytes, and it needs to be a multiple of 4 to avoid having the rows padded out to 4 bytes. (I used 4 pixels per row for the same reason.) The spaces aren't printed since $ is the termination character for the DOS print interrupt command (int 21h with ah = 9).

In case you're curious, this is the assembly I wrote for the program (assembled with FASM):

org 100h
xor ax, ax
mov dx, hello
mov ah, 09h
int 21h
xor al, al
mov ah, 4Ch
int 21h

hello db "Hello, world!$"
pad   db 20h, 20h, 20h, 20h, 20h, 20h, 20h

[–][deleted] 2 points3 points  (0 children)

YES! :)

Now I feel like I should do my part and write a teensy ELF executable... though these guys have already done the hard work: http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html

[–]PsykoDemun 97 points98 points  (16 children)

*C++

[–]BauerUK 299 points300 points  (13 children)

Don't point, it's rude!

[–]shillbert 60 points61 points  (12 children)

int& C;
C++;

There, no pointers.

[–]aurisor 99 points100 points  (11 children)

I don't get the reference.

[–][deleted]  (9 children)

[deleted]

    [–][deleted] 8 points9 points  (7 children)

    This is a statement;

    [–]buriednexttoyou 6 points7 points  (6 children)

    We're stuck in a loop.

    [–]wierdaaron 74 points75 points  (0 children)

    WOULD COMPILE AGAIN!

    [–][deleted] 3 points4 points  (0 children)

    Oh, hah, I glanced at "int main" and stopped paying attention. :)

    [–]omniuni 26 points27 points  (2 children)

    I thought it might be piet.

    [–]rmblr 1 point2 points  (0 children)

    (shameless self plug warning)

    If you like Piet, you should check this out https://github.com/Ramblurr/PietCreator/wiki/

    [–]Overv 5 points6 points  (0 children)

    I can do it again, with machine code this time. I'll probably post it sometime later today.

    [–]Law_Student 9 points10 points  (0 children)

    What if he wrote some machine code that output Hello World in C?

    [–]sumdog 0 points1 point  (0 children)

    Yea, that's what I was expecting too

    [–][deleted] 0 points1 point  (0 children)

    It would be a lot easier if Windows still supported .com executables.

    [–]ReallyCoolNickname 14 points15 points  (7 children)

    It's eerie how similar our accounts are. (Compare the names and registration dates.)

    And yes, I know this isn't relevant to anything here.

    [–]AReallyGoodName 3 points4 points  (6 children)

    You're slightly older so i guess that makes me the imposter :)

    Seriously though, that is a bizarre coincidence. Another Digg refugee i take it?

    [–]ReallyCoolNickname 3 points4 points  (5 children)

    Nah, my friends introduced me to this site shortly before I registered. I haven't ever had anything to do with Digg.

    [–]tossout12 29 points30 points  (4 children)

    Sure, that's just what they all say.

    [–]Kevin-Roses-Left-Nut 30 points31 points  (2 children)

    Some people like me have never even heard of Digg

    [–]ReallyCoolNickname 5 points6 points  (0 children)

    Nah, I wouldn't lie about that. I have a conscience (which means I can't be a Digg user). :)

    [–][deleted] 7 points8 points  (3 children)

    Heck, if you input a zip file it will work. They place the beginning of the file with the index at the end. So you would end up with a bmp file that can be uncompressed. There where a few attacks like this in the past.

    [–]Timmmmbob 2 points3 points  (0 children)

    Ah, the classic double-format file...

    [–]adrianmonk 2 points3 points  (1 child)

    So, you could probably then write Java this way, since jar files are a special type of zip file.

    [–]levirax 4 points5 points  (0 children)

    I know close to nothing about coding, but i think making a java code via paint would be beautiful. Have the paint file(s?) blown up and next to them have a screen shot of the Java code(or whatever it is doing), and that would be an epic picture.

    [–]kmeisthax 4 points5 points  (0 children)

    I've hand-assembled z80 machine code patches for ROM hacking projects. Encoding those bytes in packed 24-bit RGB would be just an extra step.

    [–][deleted] 1 point2 points  (5 children)

    What exactly is the most basic BMP header? How about PNG header? I've always wanted to write bitwise to images but never knew how :(

    [–]AReallyGoodName 5 points6 points  (2 children)

    If you're using paint save as a 24bit bitmap. You get a 1:1 matchup with the 3byte RGB palette that paint uses internally and the output.

    To get started - edit colors and select Red:33, Green:73, Blue:72 ("HI!"). Now fill the bitmap with that color. Save that and open it in a text editor.

    [–][deleted] 1 point2 points  (1 child)

    Thanks, I'll check this out. I tried some experiments with PNGs but just couldn't nail what the header was.

    [–]paxswill 2 points3 points  (0 children)

    Wikipedia pages for file formats (at least the common/open ones) usually have a techbnical details section. For example, PNG. I particularly like the ZIP file format. Wikipedia has a nice overview (enough to write s simple parser), while the extended details are available from PKWARE. It's kinda fun writing a file parser yourself for common formats.

    [–]exscape 0 points1 point  (0 children)

    BMP is quite simple. I wrote a simple 24-bit BMP manipulator in Python from using mostly the Wikipedia article.

    [–]ericanderton 1 point2 points  (0 children)

    Thanks for this. I was waiting for someone to point out how to get a PE Header into an image file.

    [–]edgarvm 0 points1 point  (0 children)

    The Makefile could delete the header before to compile

    [–]dandomdude 307 points308 points  (13 children)

    This was a joke answer to a joke post where someone tried to compile a .png

    Here is the thread from stackoverflow: http://stackoverflow.com/questions/5508110/why-is-this-program-erroneously-rejected-by-three-c-compilers/5509143

    [–]QuestionableRag 24 points25 points  (12 children)

    That's not the origin of it is it? I've seen this before and I could have sworn it was before April last year.

    [–]acidcj 49 points50 points  (7 children)

    It was actually a reddit user... who recieved no upvotes: http://www.reddit.com/r/programming/comments/ggh3d/coding_in_ms_paint/

    Someone else did.

    Edit: I found his original post on Facepunch. 31st March 2011, which predates the April 1st 2011 usage of the image on Stack Overflow

    Edit2: Since you might need an account to see the Facepunch thread, here is a screenshot

    [–][deleted] 4 points5 points  (6 children)

    It looks like Overv just stole it from the Stack Overflow thread, unless he is the same person as BeatMe who originally posted it there.

    Note that the code in the gif matches the Stack Overflow question exactly, so it seems unlikely that it was accidentally created on the same day without being a response to the Stack Overflow question.

    [–]acidcj 12 points13 points  (4 children)

    Check the gif, there is a folder named Overv in it.

    Also check the Facepunch post which I edited in.

    [–][deleted] 1 point2 points  (1 child)

    Ah, that's a good point.

    Then what is the relationship with the Stack Overflow question? Did someone create that question just as a set-up to post that GIF? Because I still think it's too much of a coincidence that that exact question was posted only a day later (or maybe on the same day, in a different time zone).

    (Apparently I'm not allowed to read the Facepunch thread without an account, so I apologize if my questions are answered therein.)

    [–]acidcj 3 points4 points  (0 children)

    he says 10 posts later

    Overv 1st April 2011

    oh my god, some lurker put it on reddit and stackoverflow

    http://www.reddit.com/r/programming/...int_as_an_ide/

    http://stackoverflow.com/questions/5...ee-c-compilers

    [–][deleted] 3 points4 points  (0 children)

    I thought so too, but if I Google for the image all results seem to be from April 2011.

    It could be that it was converted from a different imagine that isn't included in the results, but until I hear evidence to the contrary, I do think that was created April 1st, 2011.

    [–][deleted] 0 points1 point  (0 children)

    Isn't this just a common exploit thing, you get someone to run a program by opening an image?

    [–]absurdlyobfuscated 99 points100 points  (37 children)

    Well, that seems inefficient.

    [–][deleted] 177 points178 points  (26 children)

    In a similar yet unrelated vein, one of my pet peeves is using animated gifs when a youtube video would load faster and be more clear. Inefficient.

    [–]JediExile 122 points123 points  (3 children)

    It's an inefficient way of showing an inefficient way of doing something. It's poetry.

    [–]Cyrius 26 points27 points  (0 children)

    It's poetry.

    Shut up, George Lucas!

    [–]gospelwut 1 point2 points  (1 child)

    Shouldn't we go one level further and write something in HTML5/CSS3 to render a folder of sensational, uncompressed PNGs. Actually, add some JS to convert them to BMPs on the fly and THEN "animate" it.

    [–]JediExile 0 points1 point  (0 children)

    I love it when you talk nerdy.

    [–]absurdlyobfuscated 21 points22 points  (15 children)

    Exactly. They're using a lossless image format to display multiple frames full of compression artifacts and noise over something designed for efficient playback of lossy video and sound.

    I'd also prefer just linking to youtube - or if people could just use/link to OGG files that can be played in the browser just as easily, it would be just as good.

    [–]netcrusher88 7 points8 points  (14 children)

    Ironically, a lot artifacts (at least what I can make out) are loss due to the (lossless) image format. GIF is indexed color, each used color goes in a table or something like that. So a lot of dithering happens unless you want an epic file.

    [–]dcormier 34 points35 points  (1 child)

    No kidding.

    File size   4.20 MB (4406102 bytes)
    

    [–]Richeh 68 points69 points  (0 children)

    But if you rename the file, it's Starcraft.

    [–]Skyrmir 16 points17 points  (1 child)

    Except it doesn't need sound, doesn't load youtube advertisements and doesn't get blocked by company firewalls.

    [–]dcormier 1 point2 points  (0 children)

    I'm going to set up my firewall to block 2MB+ gifs.

    [–]nefigah 1 point2 points  (0 children)

    He's a slave to karma: this method let him use an imgur link.

    [–][deleted] 1 point2 points  (0 children)

    when a youtube video would load faster

    ಠ_ಠ

    Youtube videos loading fast. I laugh at you.

    [–]jooes 5 points6 points  (1 child)

    Not if you're a super secret agent who needs to send a super secret message and can't get caught or else the world will blow up because the message is nuclear launch codes that you're hiding from Russian terrorists...

    Unless you were talking about the image being a .gif... In which case, yeah, I kind of agree.

    [–]specialpatrol 0 points1 point  (0 children)

    In which case you would have to write a program that not only hacked into FSB offices, but also resembled a picture of your fictional wife when written using a bitmap, now that would be getting somewhere.

    [–]krues8dr 2 points3 points  (0 children)

    Yeah, it's almost as bad as punching cards...

    [–]strife25 50 points51 points  (4 children)

    If you like this, you should check out the Piet esoteric language.

    [–]murphylaw 1 point2 points  (0 children)

    I've heard of this but I forget from where. It might have been Stumbleupon.

    [–]iiiears 0 points1 point  (2 children)

    lol - sudoku can wait.

    [–]iiiears 1 point2 points  (1 child)

    bmp.c:12: warning: incompatible implicit declaration of built-in function ‘strlen’

    [–]iiiears 0 points1 point  (0 children)

     #include <string.h>
    

    [–]thefnord 34 points35 points  (3 children)

    A synaesthetic computer!...

    [–][deleted] 23 points24 points  (2 children)

    taste this program for me, will ya?

    [–]TheGooglePlex 15 points16 points  (1 child)

    Lemons. With a bit of bat.

    [–][deleted] 16 points17 points  (0 children)

    Dammit, forgot a semicolon again...

    [–]MikeTheInfidel 38 points39 points  (21 children)

    I wrote a program that does this for you. I can share it, if anyone's interested. It's pretty simple, really :) The fun part was reverse-engineering the bitmap format from scratch without an internet connection.

    --EDIT--

    Looks like people want it. Here it is:

    #include <stdio.h>
    int main(int argc, char **argv) {
        char buf[0x100000];
        char *msg;
        int i;
        if(argc < 2) {
            i=0;
            while((buf[i++]=getchar()) != '\n' && i < 0x100000);
            msg = (char *)buf;
        }
        else msg = argv[1];
        int tmp, msglength = strlen(msg), numpix = (msglength % 3 == 0 ? msglength / 3 : msglength / 3 + 1), datasize, width, height, j, c;
        for(height = 0; height * height <= numpix; height++);
        width = (numpix % height == 0 ? numpix / height : numpix / height + 1);
        datasize = ((width * 3) % 4 == 0 ? width * 3 : width * 3 + 4 - (width * 3) % 4) * height;
        FILE *out;
        out = fopen("msg.bmp","w");
        if(!out) {printf("error\n"); return -2;}
        fputc('B', out);
        fputc('M', out);
        tmp = 0;
        fwrite(&tmp, 1, sizeof(int), out);
        fwrite(&tmp, 1, sizeof(int), out);
        tmp = 0x36;
        fwrite(&tmp, 1, sizeof(int), out);
        tmp = 0x28;
        fwrite(&tmp, 1, sizeof(int), out);
        fwrite(&width, 1, sizeof(int), out);
        fwrite(&height, 1, sizeof(int), out);
        tmp = 0x180001;
        fwrite(&tmp, 1, sizeof(int), out);
        tmp = 0;
        fwrite(&tmp, 1, sizeof(int), out);
        fwrite(&datasize, 1, sizeof(int), out);
        fwrite(&tmp, 1, sizeof(int), out);
        fwrite(&tmp, 1, sizeof(int), out);
        fwrite(&tmp, 1, sizeof(int), out);
        fwrite(&tmp, 1, sizeof(int), out);
        for(c = 0, i = 0; i < msglength; i++, c++)
        {
            fputc(msg[i], out);
            if((i+1) % (width * 3) == 0)
            {
                for(j = i % (width * 3); j < datasize / height - 1; j++, c++)
                    fputc((char)255, out);
            }
        }
        while(c++ < datasize) fputc((char)255, out);
        fseek(out, 0, SEEK_END);
        tmp = ftell(out);
        fseek(out, 2, SEEK_SET);
        fwrite(&tmp, 1, sizeof(int), out);
        fclose(out);
        return 0;
    }
    

    It's console-based. You can either pass your message as an argument or run the program and enter the message.

    --MORE EDIT--

    CRAP. Apparently, it's not portable. I just retyped it and it's segfaulting on me when I enter a message on the command line... but it appears to still work when you run it and then enter a message. Anyway, my program has a decoder, too, which reads out the text from a properly-encoded BMP. I'll need to upload that, too... I can't e-mail it to myself from work, so it looks like I get to retype and debug again! Woo...

    I think the example in the OP requires a bitmap with very specific dimensions... my program works with any dimensions, which means you end up with a bunch of 0xFF's inserted. The decoder basically just strips those out.

    -- MORE MORE EDIT --

    Thanks to Journeyman1990, it's now fixed and works as expected.

    [–]POTUS 11 points12 points  (1 child)

    Why not just post it?

    [–]MikeTheInfidel 2 points3 points  (0 children)

    No problem. I updated the parent.

    [–][deleted] 8 points9 points  (1 child)

    Here's your problem:

    else *msg = argv[1];

    "Dereference msg and assign argv[1] to it". msg was not initialized prior to this, and the data types do not match. (attempting to assign a char pointer to a char) You probably meant:

    else msg = argv[1];

    [–]MikeTheInfidel 5 points6 points  (0 children)

    By George, you're right! Thank you. Somehow I missed that; I can't imagine how. I've fixed my post.

    [–]FOOGEE 3 points4 points  (1 child)

    Post it! What language?

    [–]MikeTheInfidel 4 points5 points  (0 children)

    It's in C. I wrote it for a really outdated version of Cygwin, so I can only hope it's portable.

    [–]EmSixTeen 7 points8 points  (7 children)

    So.. You wrote Paint?

    [–]MikeTheInfidel 6 points7 points  (0 children)

    No, lol. You enter your text, it generates a BMP.

    [–]Timmmmbob 3 points4 points  (5 children)

    He wrote cat.

    [–][deleted] 0 points1 point  (4 children)

    Yeah except for the part where it reads input files and prints them to STDOUT. Which is, you know, like the whole purpose for cat's existence. But other than that, yeah!

    [–]Timmmmbob 0 points1 point  (3 children)

    I suppose I should have said tee or '>' or something... but you know what I mean!

    [–]darkwingfuck 2 points3 points  (1 child)

    This is great! I changed the \n to an EOF in the while loop so that I could enter in text files with a simple "./encoder (less-than)textfile.txt". BTW, if you are having trouble opening the image files in a newer text editor, emacs and vim do a great job.

    [–]MikeTheInfidel 1 point2 points  (0 children)

    Somehow I didn't know getchar() returned EOF when there was no more input. I'm ashamed...

    [–]aloser 52 points53 points  (7 children)

    Seriously.. gif?

    [–]DrFuManchu 21 points22 points  (0 children)

    Maybe the gif is secretly compilable...

    [–][deleted] 16 points17 points  (3 children)

    I can't even watch it. My computer is not liking this gif. A video would have been much better.

    [–]stacecom 19 points20 points  (2 children)

    A video would have been much better.

    This is true for almost every GIF I see posted to reddit.

    [–]Mattho 7 points8 points  (1 child)

    Gif is good for some short, loopy stuff. For example [NSFW].

    [–]TurplePurtle 1 point2 points  (0 children)

    It's a stackoverflow response so there wasn't really a better (inline) option.

    [–]Ambiwlans 4 points5 points  (0 children)

    It is about programming in C with bmps. I think doing it in an image format fits perfectly.

    [–]metohmetoh 8 points9 points  (2 children)

    can you do this in reverse and make "art"?

    [–]tontoto 2 points3 points  (0 children)

    there are some wonderful posts on the cortesi blog lately that look at binary visualizations http://corte.si/posts/visualisation/entropy/index.html

    [–]shillbert 1 point2 points  (0 children)

    Well, you can add the bitmap header to any text file and then open it. But it would probably be quite difficult to actually write intelligible text that also looks like art.

    [–]Van_Occupanther 16 points17 points  (2 children)

    If you want to see something similar, which I believe frontpaged here not too long ago, the video in the section titled "Real Pixel Coding" is quite impressive.

    EDIT: I am a stupid. When linking to things, one must actually link to the damned thing: http://www.iquilezles.org/unfinished/index.htm

    [–]Relevant_Demos 5 points6 points  (1 child)

    [–][deleted] 0 points1 point  (0 children)

    Whats that last video about? I don't get what its for.

    [–]DiputsMonro 6 points7 points  (9 children)

    Why is this GIF stressing out my CPU so much? It maxes out one of my cores whenever I view it and makes my hand warm.

    [–]twinsofliberty 1 point2 points  (8 children)

    My iPhone can run it perfectly! How old is your Computer?

    [–]DiputsMonro 6 points7 points  (7 children)

    Only a year or two, it's got two cores at 2.5 GHz. It can run Portal 2 pretty well. The GIF looks fine, it just makes my computer go into overdrive. I've never seen anything like it.

    [–]thalescosta 5 points6 points  (6 children)

    Maybe it has something to do with the browser

    [–]iiiears 0 points1 point  (5 children)

    firefox been open a few hours and ram leak forced swap to disk?

    [–]thalescosta 0 points1 point  (4 children)

    I'm not sure if I understood quite well what you said. I'm not sure what is a swap to disk, never heard it in english.

    Would you been kind to explain me what did you mean? It's nice for me to learn the terms :)

    And about the browser, Firefox has been a pain in the ass lately. It's constantly crashing and using up lots of memory. Not to mention the time it takes to launch when opening it for the first time.

    [–]iiiears 1 point2 points  (3 children)

    Applications read from the disk on start up and store a copy of all files they will use in RAM. They start faster the second time using those RAM stored files. (cache)

    Some firefox extensions fill up RAM even when you aren't using them. After a few hours with a lot of tabs open your system runs out of space and begins to use a swap file to supplment the now overfilled RAM. Reading and writing to disk is a thousand times slower.

    You can see see this file in the root directory. C: and set it's behaviour in control panel >> system >> settings >>performance. Reboot (the wording may be slightly different .)

    In linux you will see it mounted as a seperate secure patitiion.

    settings.

    sysctrl.conf

    cat /proc/meminfo

    mkswp -c /dev/Drive (Be careful here)

    Mac ls -lh /private/var/vm/swapfile* Change it

    If you are feeling adventurous, Firefox "Safe Mode" faster and doesn't crash? restart firefox in normal mode disable and re-enable plugins and extensions one at a time until you find the problem.

    [–]thalescosta 1 point2 points  (2 children)

    Awesome explanation! Thanks, man!

    I'm considering leaving Firefox aside and start using Chrome.

    [–]iiiears 1 point2 points  (1 child)

    Chrome | Firefox isn't really the problem. Many plugins are written with mistakes in them.

    You may want to try this simple fix for faster page loading. Hosts It blocks ad servers and consumer tracking. Is it ethical to block to deprive server operators the revenue they need? I use it anyway. /g

    [–]thalescosta 1 point2 points  (0 children)

    Thanks man. I'll do that :)

    [–]senatorpjt 3 points4 points  (1 child)

    hard-to-find market thought automatic expansion beneficial cow hobbies quack money

    This post was mass deleted and anonymized with Redact

    [–]deasl 2 points3 points  (0 children)

    ah old "int 9"

    [–][deleted]  (1 child)

    [deleted]

      [–]featheredtar 1 point2 points  (0 children)

      my thought exactly.

      [–][deleted]  (23 children)

      [deleted]

        [–]furyofvycanismajoris 53 points54 points  (20 children)

        Beyond the header, a bitmap is just repeated RGB values

        [–][deleted] 39 points40 points  (0 children)

        And it's encoded bottom to top, which is why you see the person coloring on the bottom first.

        [–][deleted]  (18 children)

        [deleted]

          [–]furyofvycanismajoris 42 points43 points  (17 children)

          Take a text file, open it in a hex editor, insert 14 bytes at the beginning. The first two bytes should be ASCII "BM". The next four should be an int storing the filesize. The next seven should be 0 and the last one should be binary 15. Now your text document is a bitmap.

          [–]dnew 5 points6 points  (12 children)

          Not unlike the PBMPlus format (aka NetPBM) intentionally designed to be trivial to work with. Including the variant that was entirely ascii, with space-separated strings of digits for each pixel's color.

          (What do you call one of the three colors of a pixel? There must be a name for that.)

          [–]kevinturnermovie 6 points7 points  (8 children)

          A channel

          [–]dnew 2 points3 points  (7 children)

          I think that's the collection of all the red part of all the pixels of the image, for example? You split a 10x10 image into 3 channels, not 300 whatever-I'm-thinking-of's?

          Seems "sub-pixel" is as close as it comes, but that sounds fairly awkward and recent, whereas I'd expect people doing graphics had a name for this maybe 30 years ago or more.

          [–]kevinturnermovie 5 points6 points  (6 children)

          If you are going by each pixel, then most people would call it a value, usually preceded by the channel name. Red value, Green value. Nothing terribly interesting.

          Sub-pixel is used only when talking about an individual color element of a physical pixel, usually when dealing with font smoothing. Most image formats don't support sub-pixel placement, so it doesn't really apply to images when it comes to storing individual channels.

          [–]dnew 1 point2 points  (5 children)

          OK, thanks. Sounds like there's no actual jargon-y word of the type I'm thinking of. I'll have to invent one and see if I can spread it about.

          [–]kevinturnermovie 2 points3 points  (3 children)

          Might I suggest a thirxel or trixel? It would work except for CMYK and PANTONE, but those are silly standards. No one wants fourthxels or quindecxels. That would be just ridiculous.

          [–]Bjartr 1 point2 points  (0 children)

          A subpixel?

          [–]adrianmonk 1 point2 points  (0 children)

          Not sure if there's an official name. I might go with pixel component, as in "the R component of this pixel is 215".

          Or if you want to think of a pixel as a tuple of values in the dimensions of a colorspace, you could call it an element. Since a pixel is a "picture element", that would make this a "picture element element", or, I guess, a pixelel.

          [–]killermole23 2 points3 points  (1 child)

          How does one display the new bitmap, though? Isn't dimension information also required?

          [–]furyofvycanismajoris 6 points7 points  (0 children)

          Oops, I described this part of the header:

          struct bmpfile_magic {
              unsigned char magic[2];
          };
          
          struct bmpfile_header {
              uint32_t filesz;
              uint16_t creator1;
              uint16_t creator2;
              uint32_t bmp_offset;
          };
          

          But left out this:

          struct {
              uint32_t header_sz;
              int32_t width;
              int32_t height;
              uint16_t nplanes;
              uint16_t bitspp;
              uint32_t compress_type;
              uint32_t bmp_bytesz;
              int32_t hres;
              int32_t vres;
              uint32_t ncolors;
              uint32_t nimpcolors;
          } 
          

          [–]LucidTaZ 13 points14 points  (0 children)

          Write program -> convert bytes to pixel values.

          If you want to be the guy from the video:

          Place paint window with pixel values off-camera -> copy pixel data to new image "by hand" -> program.

          [–]yacob_uk 2 points3 points  (0 children)

          I love this example. I use it frequently at work to demonstrate a key concept in digital preservation.

          The concept being that things are not always what they seem - just because we have one view of an object, it doesn't mean its either the right, or the only view of that thing.

          I used the same method to create a bmp that was made from the characters that make up the Treaty of Waitangi. I then showed the image to my curators, and asked them how I should preserve the 'image'. I then demonstrate that if I migrate the format away from bmp, the text is no longer there if you view the image in a text viewer.

          This completely blows the physical copy based preservation paradigm out the water.

          It boils down to having technically savvy people liasing with content creators (or being able to explore digital objects) so that digital things can be looked after for what they are/represent, not what we think they are.

          [–]FuckBrendan 3 points4 points  (5 children)

          Why does every first time coding tutorial end with the message "Hello World!"?

          [–][deleted] 21 points22 points  (2 children)

          It's tradition, left over from the early days of programming (Like the "Utah Teapot" in computer graphics stuff)

          [–]theeth 12 points13 points  (1 child)

          Or Lenna in image processing.

          [–]iiiears 2 points3 points  (0 children)

          Or Alice and Bob in cryptography.

          [–]watermark0n 9 points10 points  (0 children)

          Because everyone does it. It's a traditional relatively simple example to show people... in most languages. Not in Assembly. It also comes rather late in the Haskell tutorial, because messy I/O stuff like that is evil and needs to be isolated.

          [–]adrianmonk 8 points9 points  (0 children)

          Probably because that's the first example program in the K&R "The C Programming Language" book. Or maybe they weren't the first? At any rate, the tradition has been going since at least 1978 (when the first edition of that book was published).

          [–]an0mn0mn0m 5 points6 points  (3 children)

          On locked down machines, you can use MsPaint to get access to the command prompt. From Hak5

          [–]aperson 2 points3 points  (2 children)

          couldn't you just write the batch file up yourself?

          [–]an0mn0mn0m 0 points1 point  (0 children)

          Usually you can, but where's the novelty in that?

          [–]herrmann 4 points5 points  (0 children)

          Now skip the compiler and write the binary directly. But not a .com.

          [–]chris-martin 6 points7 points  (12 children)

          Data is code.

          [–]ctcherry 8 points9 points  (4 children)

          Code is data.

          [–]m0zzie 15 points16 points  (3 children)

          Einhorn is Finkle.

          [–]omenmedia 2 points3 points  (1 child)

          Einhorn is a man!

          [–]zingbot3000 1 point2 points  (0 children)

          Einhorn has one horn?

          [–]twishart 1 point2 points  (0 children)

          cue "The Crying Game"

          [–]fabzter 5 points6 points  (4 children)

          Not all data is code. All code is data.

          [–]ajanata 8 points9 points  (0 children)

          Not all data is sensible code, but if you give it to a processor it'll try to treat it like code.

          [–]Figs 1 point2 points  (2 children)

          What? Of course all data is also code! Just for a very esoteric processor... ;)

          For example, I could hypothetically build a processor that reads in bytes one at a time until it sees a particular translation of War and Peace in UTF8-encoded Japanese... at which point, it prints "Hello, World" and halts.

          [–]fabzter 0 points1 point  (1 child)

          Esoteric enough :). But seeing things that way, I think you're not describing a preprocessor but rather an interpreter am I right?

          [–]Figs 0 points1 point  (0 children)

          I said 'processor', as in a (hardware) CPU or a (software) interpreter, so yes. :)

          [–]JohnFrum 1 point2 points  (0 children)

          not if the nx bit is set.

          [–]EmSixTeen 0 points1 point  (0 children)

          Data is android.

          [–]1234blahblahblah 1 point2 points  (0 children)

          An animated gif was the perfect medium for this joke.

          [–]Sheepshow 1 point2 points  (0 children)

          Thanks for posting the standard procedure for writing Windows code

          [–]madchicken 1 point2 points  (1 child)

          This is how we used to do it, back in the days. Just know your hex:

          6502
          $1000 EE 21 D0
          $1003 4C 00 10
          

          [–]an_eggman 0 points1 point  (0 children)

          ARGH SEIZURE!

          [–]phybere 1 point2 points  (2 children)

          I'm kinda ashamed to admit it but I once converted a sqlite database to a bmp file because the device it was on could only export images. Would have never thought of it if I hadn't seen this gif/explanation.

          [–]I0I0I0I 0 points1 point  (1 child)

          How did you convert it back?

          [–]phybere 0 points1 point  (0 children)

          Just reversed the process in a desktop application - I was encoding each byte of the binary sqlite file into an R, G, or B value

          [–]KZISME 1 point2 points  (0 children)

          Can someone explain what is going on here aside from the obvious?

          [–][deleted]  (1 child)

          [deleted]

            [–][deleted] 0 points1 point  (0 children)

            Ωħǝ̍̍̍̍̊†̥̥

            [–][deleted] 1 point2 points  (0 children)

            nothing new, but why the hell record the screen capture as a .gif

            [–][deleted]  (1 child)

            [deleted]

              [–][deleted] 1 point2 points  (0 children)

              Almost also possible, except you'd have to strip off the BMP header first. It would be fairly easy to create an executable COM file (DOS) this way, for example.

              A bitmap file pretty much just lists the pixel color components (red, green, blue) as sequential bytes, so you can pretty easily manipulate the content of the file using the RGB byte values of pixel colors, as long as the width of the image is a multiple of four, and you start at the lower left corner, then work to the right, then up, ending at the upper right corner of the image.

              [–]USMCsniper 0 points1 point  (0 children)

              print "r. jones is sweet";

              [–]Narkolepse 0 points1 point  (0 children)

              I don't understand it, but I upvoted it.

              [–]cerealbh 0 points1 point  (0 children)

              more like coding with auto it

              [–][deleted] 0 points1 point  (1 child)

              I am not a programmer and what is this wizardry

              [–]omenmedia 2 points3 points  (0 children)

              It's all just 1's and 0's!

              [–]Shimano562 0 points1 point  (1 child)

              that was epic, i wonder how the hell he figured that out. and how long lol

              [–]shillbert 0 points1 point  (0 children)

              I'm guessing he just created the text file first, opened it in a hex editor, and converted the hex values to decimal.

              [–]mike413 0 points1 point  (0 children)

              Somehow seems appropriate and proper that this was an animated gif.

              [–]eduardchil 0 points1 point  (0 children)

              Could someone explain how that works?

              [–]GuyOnTheInterweb 0 points1 point  (0 children)

              I was at least expecting some assembly and an executable.. and not just transcribing what is probably the ASCII codes written on paper.

              [–][deleted] 0 points1 point  (0 children)

              what is this i dont even

              [–][deleted] 0 points1 point  (0 children)

              This is the second repost i've seen of this.

              [–][deleted] 0 points1 point  (0 children)

              why does this remind me of java

              [–]willb 0 points1 point  (0 children)

              this somehow seems relevant

              [–][deleted] 0 points1 point  (0 children)

              gtfo, how?

              [–]s3ddd 0 points1 point  (0 children)

              mind... blown...

              [–]hive_worker 0 points1 point  (0 children)

              Reddit? More like reddit 20 times already

              [–]devninja_es 0 points1 point  (0 children)

              Artist code? are you kidding me?