mirror of
https://github.com/scrtwpns/mixbox.git
synced 2026-03-19 22:49:41 +01:00
add mixbox for python
This commit is contained in:
17
python/examples/npcv.py
Normal file
17
python/examples/npcv.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import cv2
|
||||
import numpy as np
|
||||
import mixbox
|
||||
|
||||
height = 256
|
||||
width = 256
|
||||
img = np.zeros((height, width, 3), np.uint8)
|
||||
|
||||
rgb1 = (0, 33, 133) # blue
|
||||
rgb2 = (252, 211, 0) # yellow
|
||||
|
||||
for x in range(0, 256):
|
||||
for y in range(0, 256):
|
||||
img[x, y] = mixbox.lerp(rgb1, rgb2, x / 255.0)
|
||||
|
||||
cv2.imshow("image", cv2.cvtColor(img, cv2.COLOR_RGB2BGR))
|
||||
cv2.waitKey(0)
|
||||
Reference in New Issue
Block a user