Results 1 to 7 of 7

Thread: Understanding RGB888

  1. #1
    Join Date
    Jun 2010
    Location
    Cincinnati, Ohio, USA
    Posts
    92
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Question Understanding RGB888

    Here is the info I have on my image source:

    All images are raw byte data in order of RGBRGBRGB…. The pixel order is from left to right and from top to bottom. The size of image is fixed: 160 pixels x 120 pixels

    So if I am understanding RGB888 correctly, 8-bits of R, 8-bits of G, 8-bits of B, repeat... The source images are in RGB888 format, would you agree?

    Sam

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Understanding RGB888

    Yes, it's the classic 24-bit RGB system.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jun 2010
    Location
    Cincinnati, Ohio, USA
    Posts
    92
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Understanding RGB888

    I know there is one RGB format that pads each scan line to 4 bits with zeros. I assume RGB888 does not do this, correct?

  4. #4
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Understanding RGB888

    After RGB there is bit representation for each channel. 888 means 3x8bit = 24bit, 444 -> 3x4 = 12bit. http://en.wikipedia.org/wiki/RGB_color_model
    If You see something like RGB 4:4:4 that means subsampling for one of channels in YCbCr: http://en.wikipedia.org/wiki/Chroma_subsampling

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Understanding RGB888

    Quote Originally Posted by scarleton View Post
    I know there is one RGB format that pads each scan line to 4 bits with zeros. I assume RGB888 does not do this, correct?
    (8+8+8) mod 4 = 0 thus there can be no padding here.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Jun 2010
    Location
    Cincinnati, Ohio, USA
    Posts
    92
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Understanding RGB888

    Quote Originally Posted by wysota View Post
    (8+8+8) mod 4 = 0 thus there can be no padding here.
    My bad, I ment bytes, not bits. I think it is Windows native image format that does this. I am guessing it is because 32-bit OS's work the quickest in 4 byte chuncks, though it is a pain to save out Further more I take it that this is not how RGB888 works, correct?

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Understanding RGB888

    Quote Originally Posted by scarleton View Post
    My bad, I ment bytes, not bits. I think it is Windows native image format that does this.
    Native Windows format is BMP which is vertically mirrored BGR 8b or 24b without any padding, as far as I remember.

    I am guessing it is because 32-bit OS's work the quickest in 4 byte chuncks, though it is a pain to save out
    Honestly I never heard of such padding, it would be a pure waste of memory space. Padding usually occurs only at the end of some data, not in the middle of it. Of course I don't deny such formats may exist, I just never had any experience with those Image formats tend to have multiple of word length as their bit per gun anyway. Of course the word length might be different for different architectures.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Understanding highlighting in a QTableView
    By scarleton in forum Qt Programming
    Replies: 7
    Last Post: 11th July 2010, 13:32
  2. Better understanding of the ModelView archtecture
    By scarleton in forum Qt Programming
    Replies: 6
    Last Post: 28th June 2010, 07:07
  3. Trouble understanding QQuaternions
    By MattPhillips in forum Qt Programming
    Replies: 2
    Last Post: 21st April 2010, 02:40
  4. I need help understanding QGraphicsView
    By aarelovich in forum Qt Programming
    Replies: 13
    Last Post: 22nd July 2009, 20:02
  5. QThread - general understanding
    By soul_rebel in forum Qt Programming
    Replies: 10
    Last Post: 21st August 2007, 23:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.