
How's your art project going?

Not very wellπ

Why not?

Somehow I cann't stop thinking about the image encoding thing

π² Oh no, I think Prof Evergreen has found a way to get into your mind!

Yep. It seems easy at the begining. The image can be represently by a collection of small colorful dots called pixels

For the jump man image, there are 16*16=256 pixels in total, each pixel can be encoding with RGB

so it is FFFFFF FFFFFF FFFFFF FFFFFF FFFFFF FF0000 FF0000 FF0000 FF0000 FF0000...

Yes, isn't that all? We got an image encoded in Binary! πππ

But there is a problem! how to tell the computer this picture has 16 rows? Currently everyhing is in one big row!

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'π

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

Sure, let me check my history book

Oh, here it is, BMP, the Bitmap Image File Format. 1985, pretty old huh?

OK, let me load its data...

ok, the data part is pretty the same ... RGB encoding... except they order the pixels upside down

Aha! Starlax, I think you are a true genius, they do put a note at the front

What? I was jokingπ₯΄

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)

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

Come onπ...btw that name PNG was taken...Portable Network Graphics, 1996

bummer