In general, strokes can only be applied at places where the color difference between target image and canvas can be lowered by applying a brush stroke with the selected paint. For gray-scale input this is equivalent to the gray-scale difference of all pixels under the stroke being larger than the opacity of an additional layer of paint, in the chromatic case this has to be measured for all color channels.