Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to open image in RGB32 mode [SOLVED]
Forum Updated to NodeBB v4.3 + New Features

How to open image in RGB32 mode [SOLVED]

Scheduled Pinned Locked Moved General and Desktop
qt5.4image
6 Posts 2 Posters 1.9k Views 2 Watching
  • 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.
  • sosunS Offline
    sosunS Offline
    sosun
    wrote on last edited by sosun
    #1

    I'm trying to open an image like follows:

    Qimage image("/home/john/pic.png", QImage::Format_RGB32);
    

    But it gives me an error : no matching function call to QImage::QImage(const char [], QImage::Format);

    The reason I'm asking is that my picture being processed as greyscale or 8bit or whatever, but not colored as I need. Look at the 3rd comment in this question: http://stackoverflow.com/questions/31163679/how-to-make-gaussian-blur-work-properly

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      If I understand you correctly, you have an unusual png formatted image ?

      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
      • sosunS Offline
        sosunS Offline
        sosun
        wrote on last edited by
        #3

        @SGaist as I figured out there was no problem in image, but in my code. Anyway, thanks. I'll mark it as solved.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Was the problem only the wrong constructor called ?

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

          sosunS 1 Reply Last reply
          0
          • SGaistS SGaist

            Was the problem only the wrong constructor called ?

            sosunS Offline
            sosunS Offline
            sosun
            wrote on last edited by
            #5

            @SGaist I tried to change the complete logic of my app so I wasn't needed in constr like this, but picture was still colorful and this because I don't think I was ever needed to construct image in that way. Maybe Qt takes an advantage of guessing what picture looks like on itself?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              There's no guessing, Qt will load your image with the corresponding plugin which uses the usual libraries to manipulate the images (libpng, libjpeg etc.). Then IIRC there might be a conversion to a format suited for display e.g. ARGB32.

              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
              1

              • Login

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