Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. RGB BGR colors issue on my linux target
QtWS25 Last Chance

RGB BGR colors issue on my linux target

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
linuxfbembeddedcolor changergb bgrqimage
9 Posts 7 Posters 6.6k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IL
    wrote on 12 Apr 2016, 11:18 last edited by IL
    #1

    Hi all,
    I am working on my beaglbone like linux target with QT using linuxfb platform plugin and I have colors issue on my screen.
    Red display as blue on my target. All blue related colors like light-blue and purple display red with variasity.
    Green display OK.
    I have load rainbow of colors using JPG without QT and it's looking good, means that my problem is in QT and probably in my linux-frameBuffer platform plugin.

    in file linuxfbscreen.cpp of the FB plugin code, I have found that it determine the format as RGB888, I also have tried to swap from RGB to BGR using QImage::rgbSwapped() method but nothing display on my screen.

    Can someone give me hint about this issue?

    Best regards,
    Ilan

    1 Reply Last reply
    0
    • I Offline
      I Offline
      IL
      wrote on 13 Apr 2016, 10:59 last edited by IL
      #2

      Someone please advice!

      1 Reply Last reply
      0
      • I Offline
        I Offline
        IL
        wrote on 13 Apr 2016, 14:27 last edited by IL
        #3

        OK so this is definitely an RGB to BGR issue!!
        I have set 3 colors on one of my pages for RGB colors:
        RED set as (255, 0, 0)
        GREEN set as (0, 255, 0)
        BLUE set as (0, 0, 255)
        On the host (my PC) the colors are OK but on my target the appearance of each one of the above was:
        For (255, 0, 0) I got BLUE - (very bad should be RED)
        For (0, 255, 0) I got green (good)
        For (0, 0, 255) I got RED - (very very bad - should be BLUE)

        Any idea what the hack? :-(

        K 1 Reply Last reply 13 Apr 2016, 19:03
        0
        • I IL
          13 Apr 2016, 14:27

          OK so this is definitely an RGB to BGR issue!!
          I have set 3 colors on one of my pages for RGB colors:
          RED set as (255, 0, 0)
          GREEN set as (0, 255, 0)
          BLUE set as (0, 0, 255)
          On the host (my PC) the colors are OK but on my target the appearance of each one of the above was:
          For (255, 0, 0) I got BLUE - (very bad should be RED)
          For (0, 255, 0) I got green (good)
          For (0, 0, 255) I got RED - (very very bad - should be BLUE)

          Any idea what the hack? :-(

          K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 13 Apr 2016, 19:03 last edited by
          #4

          @IL
          Do allow for some time so people can respond. Could you provide some source how you make your calls and how you load your image; everything that'd be related to the issue?

          Kind regards.

          Read and abide by the Qt Code of Conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 13 Apr 2016, 20:45 last edited by
            #5

            Hi,

            To add to @kshegunov, what board is it ? BeagleBone like doesn't provide much information. You graphic device might be in BGR and there's some adjustment to do LinuxFB wise.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • D Offline
              D Offline
              dvolosnykh
              wrote on 20 Sept 2016, 07:43 last edited by
              #6

              We are facing the same issue with BeagleBone Black board running Qt 4.8.6 application.
              @IL Have you managed to resolve this issue?

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Mikkie
                wrote on 1 Oct 2016, 18:36 last edited by
                #7

                Guys, I had the same issue with a SAMA5 board. It turned out to be a difference between QT and linuxfb formats. I edited the fbdevice file in qtcore. There was a bug listed about this issue. I will try and find it and post it again. I made also made an edit for some rotation of the display. After the edit for the swap colors, it still did not work because linux kernel were not reporting things correctly, so I hardcoded the swap of colors.

                Let me know if this is still an issue, then I will find the stuff and post it.

                S 1 Reply Last reply 25 May 2018, 15:46
                0
                • M Mikkie
                  1 Oct 2016, 18:36

                  Guys, I had the same issue with a SAMA5 board. It turned out to be a difference between QT and linuxfb formats. I edited the fbdevice file in qtcore. There was a bug listed about this issue. I will try and find it and post it again. I made also made an edit for some rotation of the display. After the edit for the swap colors, it still did not work because linux kernel were not reporting things correctly, so I hardcoded the swap of colors.

                  Let me know if this is still an issue, then I will find the stuff and post it.

                  S Offline
                  S Offline
                  SilverSurfer
                  wrote on 25 May 2018, 15:46 last edited by
                  #8

                  @Mikkie

                  I am facing a similar issue.

                  I fetch frames from linux machine(server) and displaying them on a windows machine(client).

                  The image I see in R and B swapped. (I have use QImage to draw image onto a QWidget)

                  QImage((uchar*)buffer, widht , height , QImage::Format_RGB888)
                  

                  If I dump the contents of the buffer received into a file and open it using Windows Image Viewer I observe the Colors in expected format.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    swansorter
                    wrote on 8 Oct 2020, 06:54 last edited by
                    #9

                    i am facing same problem
                    how to resolve this

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved