python rgb color code example
Example 1: simple colours python
pip install simple-colors
from simple_colors import *
print(green('hello'))
print(green('hello', 'bold'))
print(green('hello', ['bold', 'underlined']))
Example 2: how to save the color graph n open cv
import cv2
color_img = cv2.imread('cat.jpeg')
gray_img = cv2.imread('cat.jpeg',0)
cv2.imshow('Cat image', color_img)
k = cv2.waitKey(0)
if( k == ord('c') ):
cv2.imwrite('color.jpg', color_img )
print("Image is saved color")
cv2.destroyAllWindows()
if( k == ord('g') ):
cv2.imwrite('gray.jpg', gray_img )
print("Image saved in grayscale")
cv2.destroyAllWindows()