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. Change the colors palette for images ?
Forum Updated to NodeBB v4.3 + New Features

Change the colors palette for images ?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.6k 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.
  • W Offline
    W Offline
    wowy
    wrote on last edited by
    #1

    Hi,

    I am working a a lttle gui application but when i use a png as an icon for a pushbutton or for a label the colors are wrong (for example blue is purple, black is blue...) on my target (only of the image, the colors of the forms are good).

    is there a way to chnage the palette used by qt when reading, displaying a picture ?

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      If the image is paletted 8-bit format then you can set individual colos using setColor.
      There's no built-in function to color-correct an image. You would have to use a third party library (like OpenCV) for that or do it manually.

      One thing to check though are the ICC profiles embedded in the png files. Removing them might solve the issue. Image editors usually have this option when exporting images in png format.

      1 Reply Last reply
      1
      • W Offline
        W Offline
        wowy
        wrote on last edited by wowy
        #3

        It seems that the blue is blue, green is becoming red and red is becoming green. When comparing the normal image and what is displayed.

        I tryied using a jpeg, nothing appears (i even put the imageformat folder in /Trolltech.../plugins and in the folders where the application is).

        A black and white image is not problem but a all the png are weird, which is strange because when testing the same kind of program on an ubuntu pc the colors are good.

        1 Reply Last reply
        0
        • W Offline
          W Offline
          wowy
          wrote on last edited by
          #4

          Ok this seems to work.
          For anyone curious to make it works :
          I downloaded gimp, open my image then image>mode>indexed.
          Saving the image as indexed and not with rgb channels seems to do the trick.

          I 1 Reply Last reply
          0
          • W wowy

            Ok this seems to work.
            For anyone curious to make it works :
            I downloaded gimp, open my image then image>mode>indexed.
            Saving the image as indexed and not with rgb channels seems to do the trick.

            I Offline
            I Offline
            Ittries68
            Banned
            wrote on last edited by Ittries68
            #5
            This post is deleted!
            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