Avatar
How's your art project going?
Avatar
Not very well😞
Avatar
Why not?
Avatar
Somehow I cann't stop thinking about the image encoding thing
Avatar
😲 Oh no, I think Prof Evergreen has found a way to get into your mind!
Avatar
Yep. It seems easy at the begining. The image can be represently by a collection of small colorful dots called pixels
Avatar
For the jump man image, there are 16*16=256 pixels in total, each pixel can be encoding with RGB
Avatar
so it is FFFFFF FFFFFF FFFFFF FFFFFF FFFFFF FF0000 FF0000 FF0000 FF0000 FF0000...
Avatar
Yes, isn't that all? We got an image encoded in Binary! πŸŽ‰πŸŽ‰πŸŽ‰
Avatar
But there is a problem! how to tell the computer this picture has 16 rows? Currently everyhing is in one big row!
Avatar
Err... how about you put a note at the begining saying 'Dear computer, this image is 16*16, please start a new row after each 16 pixels'😜
Avatar
Come on! I am really bother by this, can you find some real-world image format for reference? Better be OLD as they tend to be simpler
Avatar
Sure, let me check my history book
Avatar
Oh, here it is, BMP, the Bitmap Image File Format. 1985, pretty old huh?
Avatar
OK, let me load its data...
Avatar
ok, the data part is pretty the same ... RGB encoding... except they order the pixels upside down
Avatar
Aha! Starlax, I think you are a true genius, they do put a note at the front
Avatar
What? I was jokingπŸ₯΄
Avatar
They call it header, bascially it starts with BM in ASCII (42 4D) to tell this is a bitmap format, then followed by some information about the file, like size of the file, and the width and height of the image (10 10)
Avatar
Oh...too bad we didn't invent a new file format...I thought we can name it after my cat if we did. like 'Purry Nova Graphics', PNG for short
Avatar
Come onπŸ˜’...btw that name PNG was taken...Portable Network Graphics, 1996
Avatar
bummer