Announcement

Collapse
No announcement yet.

RGB and Binary

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • RGB and Binary

    If I had a gray pixel on screen, which is ( R128, G128, B128 ), how would that look? is 1 pixel = 1 byte (8 bits)? 1 byte = 8 number, so it wouldn't fit, because you would need 9 places.
    Bobby Parker
    www.bobby-parker.com
    e-mail: info@bobby-parker.com
    phone: 2188206812

    My current hardware setup:
    • Ryzen 9 5900x CPU
    • 128gb Vengeance RGB Pro RAM
    • NVIDIA GeForce RTX 4090
    • ​Windows 11 Pro

  • #2
    They are usually stored as byte values. A byte is able to store 256 distinct values, and you need 3 bytes to store RGB 8bit. 8bit is per channel, not per pixel.

    Regards,
    Thorsten

    Comment


    • #3
      If your question was how the byte value of 128 is expressed as a binary, then the answer is 10000000.

      Regards,
      Thorsten

      Comment


      • #4
        Originally posted by instinct View Post
        If your question was how the byte value of 128 is expressed as a binary, then the answer is 10000000.

        Regards,
        Thorsten
        Yes. 12-10's and 1-8 to equal a channel. I'm trying to visualize how this works. How did you get 10000000?
        Bobby Parker
        www.bobby-parker.com
        e-mail: info@bobby-parker.com
        phone: 2188206812

        My current hardware setup:
        • Ryzen 9 5900x CPU
        • 128gb Vengeance RGB Pro RAM
        • NVIDIA GeForce RTX 4090
        • ​Windows 11 Pro

        Comment


        • #5
          I'll do a little reading tonight

          http://www.math.grin.edu/~rebelsky/C...ry.html#1011-a
          Bobby Parker
          www.bobby-parker.com
          e-mail: info@bobby-parker.com
          phone: 2188206812

          My current hardware setup:
          • Ryzen 9 5900x CPU
          • 128gb Vengeance RGB Pro RAM
          • NVIDIA GeForce RTX 4090
          • ​Windows 11 Pro

          Comment


          • #6
            it's actually rather simple. You have 8 bits. each bit represents a power of two. So the eigth bits correspond to:
            128|64|32|16|8|4|2|1

            These are ignored if the bit is 0 and added if it is 1.

            so e.g. 3 is represented as:
            128 64 32 16 8 4 2 1
            0 0 0 0 0 0 1 1
            or as in the previous example 128 as
            128 64 32 16 8 4 2 1
            1 0 0 0 0 0 0 0
            256 is all 1 obviously.

            Regards,
            Thorsten

            P.S. Things get a bit more complex if we're talking floating point representations instead of integers, no matter what bit-depth.

            Comment


            • #7
              Originally posted by instinct View Post
              it's actually rather simple. You have 8 bits. each bit represents a power of two. So the eigth bits correspond to:
              128|64|32|16|8|4|2|1

              These are ignored if the bit is 0 and added if it is 1.

              so e.g. 3 is represented as:
              128 64 32 16 8 4 2 1
              0 0 0 0 0 0 1 1
              or as in the previous example 128 as
              128 64 32 16 8 4 2 1
              1 0 0 0 0 0 0 0
              256 is all 1 obviously.

              Regards,
              Thorsten

              P.S. Things get a bit more complex if we're talking floating point representations instead of integers, no matter what bit-depth.
              That's what I'm talking about! I faintly remembered how it worked, but I couldn't piece it together in me head. Thanks for the help.
              Bobby Parker
              www.bobby-parker.com
              e-mail: info@bobby-parker.com
              phone: 2188206812

              My current hardware setup:
              • Ryzen 9 5900x CPU
              • 128gb Vengeance RGB Pro RAM
              • NVIDIA GeForce RTX 4090
              • ​Windows 11 Pro

              Comment


              • #8
                Originally posted by instinct View Post
                it's actually rather simple. You have 8 bits. each bit represents a power of two. So the eigth bits

                256 is all 1 obviously.

                P.S. Things get a bit more complex if we're talking floating point representations instead of integers, no matter what bit-depth.
                Correction: "255* is all 1 obviously"
                Colin Senner

                Comment


                • #9
                  Originally posted by MoonDoggie View Post
                  Correction: "255* is all 1 obviously"
                  True...was indexing 1- ... that's due to my TP origins i guess

                  Comment


                  • #10
                    because we use 0, correct? 0-255, which gives you the 256... it's all coming back now )
                    Bobby Parker
                    www.bobby-parker.com
                    e-mail: info@bobby-parker.com
                    phone: 2188206812

                    My current hardware setup:
                    • Ryzen 9 5900x CPU
                    • 128gb Vengeance RGB Pro RAM
                    • NVIDIA GeForce RTX 4090
                    • ​Windows 11 Pro

                    Comment

                    Working...
                    X