A brief overview of the main color models with interactive visualization.
from color_model_plot import *
import numpy as np
from PIL import Image
from _utils import *
img_in = Image.open('../_data/babuino.png')
img_in = img_in.resize((128, 128), Image.ANTIALIAS)
img_in = np.asarray(img_in)/255
summary(img_in)
R G B min: 0.0706 0.0431 0.0039 1st Quar: 0.3882 0.3804 0.2824 median: 0.5137 0.5059 0.3961 mean: 0.5391 0.5056 0.4438 3rd Quar: 0.6588 0.6314 0.5608 max: 0.9961 0.8392 1.0000 sigma: 0.2009 0.1595 0.2215
histogram(img_in, interval=[0, 1])
Color model based on the cartesian coordinates, where each primary color is represented by an axis.
N1, N2, C = img_in.shape
RGB = img_in.reshape(-1, C)
plotRGB(RGB)