How to change the brightness and contrast of a Pixmap?
Solved
Qt for Python
-
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.
-
Hi,
AFAIK, no, not like that.
However Qt and OpenCV mixes pretty well so you should be able to use them together without issue.
-
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?
-
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.