How to calculate the colors of pixels of a stroke given a pixel’s position on the canvas???

From experience of real painting, strokes has a general nature of randomization determined by paper and painting material. On top of basic randomization, the appearance varies on the density and size of randomization as a result of different painting forces driven by painter’s emotion.

To simulate aesthetic-driven strokes connected to our heart / emotion / mind, we could use a basic randomization as the raw model of the stroke, then modify the density and size of the basic randomization to reflect emotion:

  • Stroke equation: randomization equation with configurable density and size
  • randomization equation: noise function with evenly distributed density and size
  • configure density: apply a density equation to the noise function
  • configure size: apply a size equation to the noise function

Stroke equation:

Stroke = density equation * size equation * basic randomization

An illustration of what the stroke equation will produce: in the following image, the top stroke is drawn with strong force, hence corresponds to high density and big size. The middle and bottom strokes are drawn with light force, which are close to the look produced by basic randomization with identity density and size.


Lastly.. Happy Thursday! Nov 16, 2017


Edited on Feb 15, 2018

The appearance of stroke is determined by the rough surface of paper, which catches different part of the petal to be sticked on the surface of the paper. With evenly distributed force for drawing, the amount of petals sticked on the surface is stochastic. With varying force during drawing, the amount of petals sticked onto the surface is determined by the force, the stochastic amount of petals, and the roughness of the paper surface.

PetalAmount(x, y) = f(PaperSurfaceRoughness(x, y), DrawingForce(x, y), EasinessOfDetachingPetalToPaperSurface(x, y)) = PaperSurfaceRoughness(x, y) * DrawingForce(x, y) * EasinessOfDetachingPetalToPaperSurface(x, y)

  • PetalAmount(x, y) is the amount of petal sticked to pixel (x, y) of the area of a stroke
  • PaperSurfaceRoughness(x, y) is the roughness of the paper surface at pixel (x, y) of the area of a stroke
  • DrawingForce(x, y) is the force used to draw by the user’s hand at pixel (x, y) of the area of a stroke
  • EasinessOfDetachingPetalToPaperSurface(x, y) represents the easiness of detaching the petal while drawing at pixel (x, y) of the area of a stroke
  • NOTE: could use Perlin Noise for all the above functions