But .txt is not the same as .rs; yet .txt is not the same as .docx, although both of these files look the same to the human eye.

  • Aniki@feddit.org
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    2 hours ago

    an image, technically, is an array of pixels. specifically a 2-dimensional array. this means, it’s just a long list of lists of pixels. so if you have a 1920x1080 image, it’s just a list of 1080 lists of 1920 pixels each.

    each pixel, again, is a tuple (i.e. a list with fixed length) of numbers which specify the brightness of red / green / blue lamp. so if you want to display a yellow pixel, the data would be (1.0, 1.0, 0.0) which turns red and green on and blue off.

    so if you have a 1920x1080 image, technically you have 1920*1080*3 ≈ 6 million numbers. each number takes 32-bit, you can read it here