Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. How to change the brightness and contrast of a Pixmap?
Forum Updated to NodeBB v4.3 + New Features

How to change the brightness and contrast of a Pixmap?

Scheduled Pinned Locked Moved Solved Qt for Python
4 Posts 2 Posters 1.5k Views 1 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.
  • feiyuhuahuoF Offline
    feiyuhuahuoF Offline
    feiyuhuahuo
    wrote on last edited by
    #1

    Does QT has functions like opencv functions which can change the brightness and contrast easily?
    Like,

    img = cv2.imread('sample.png')
    img *= 1.2    # this increase the img contrast
    img += 30    #  this increase the img brightness
    

    I found some code that using for...loops to change the Qimage pixel one by one. But I think this may be slow.

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

      Hi,

      AFAIK, no, not like that.

      However Qt and OpenCV mixes pretty well so you should be able to use them together without issue.

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

        Hi, I try to avoid using OpenCV because I want to use as few packages as possible. So how to do it in a Qt way?

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

          Well, you will have to reimplement the low-level mathematics yourself for all the operations you want.

          Minimizing dependencies is a good goal, getting rid of a library which is optimized for what you want to do might not be the best idea.

          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
          2

          • Login

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