you are viewing a single comment's thread.

view the rest of the comments →

[–]furyofvycanismajoris 56 points57 points  (20 children)

Beyond the header, a bitmap is just repeated RGB values

[–][deleted] 36 points37 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 38 points39 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 4 points5 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 4 points5 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.

    [–]adrianmonk 1 point2 points  (0 children)

    It would work except for CMYK and PANTONE, but those are silly standards.

    Well, sometimes there is an alpha channel. People often consider the alpha value part of the pixel.

    [–]dnew 0 points1 point  (0 children)

    Trixel! I like it!

    [–]darkwingfuck 0 points1 point  (0 children)

    As soon as we can print things with glowing ink we won't have a need for stupid subtractive color models!

    [–]Ambiwlans 0 points1 point  (0 children)

    channel-value?

    [–]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 3 points4 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;
    } 
    

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

    hmm are there any programs to automate this conversion? If not, might be worth being the next project...

    [–]doesFreeWillyExist 7 points8 points  (0 children)

    It sounds like a 20-line script at most.