I would like to fade the color of a pixel out toward white, but obviously maintain the same color. If I have a pixel (200,120,40)
, will adding 10 to each value to m
It's not that simple because in your monitor each color channel is weighted differently. I'd say the best bet is to do this in scikit image by converting to gray, dimming or brightening, and then back-converting to color. Scikit-image will take care of keeping the colors straight.
from skimage.color import gray2rgb, rgb2gray
scale_factor = 0.9 #90 percent
img_new = gray2rgb(rgb2gray(img) * scale_factor)
If you want to work directly with hue, saturation and value, check out this example:
http://scikit-image.org/docs/dev/auto_examples/plot_tinting_grayscale_images.html