Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Increasing the value is tricky and can be done in any of the above mentioned methods depending on the application it is being used in.

To decrease the brightness is still much easy, just changing the V channel by a factor less than 1.0

Code

mImage = cv2.imread('image1.jpg')

hsvImg = cv2.cvtColor(mImage,cv2.COLOR_BGR2HSV)

# decreasing the V channel by a factor from the original
hsvImg[...,2] = hsvImg[...,2]*0.6

plt.subplot(111), plt.imshow(cv2.cvtColor(hsvImg,cv2.COLOR_HSV2RGB))
plt.title('brightened image'), plt.xticks([]), plt.yticks([])
plt.show()