[Tex/LaTex] Chalkboard texture for tikz lines

diagramstikz-pgf

How can one simulate chalkboard lines in Tikz?

Chalk texture on blackboard. Arrows, circles and other shapes.

Perhaps something in this lines could work, but a) would it then be necessary to specify lines as regions? and b) I cannot compile the code in the previous link, which makes pdflatex -shell-escape wondering:

[. . .]
Package pgfplots notification 'compat/show suggested version=true': document ha
s been generated with the most recent feature set (\pgfplotsset{compat=1.12}).

Runaway definition?
->
! TeX capacity exceeded, sorry [main memory size=5000000].
\pgfplotsapplistXXpushback@smallbufoverfl ...toka
                                                  \the \t@pgfplots@tokb \the...
l.16   \addplot3[surf,shader=interp] {rand};

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on papyrus.log.

Edit: It seems that chalk-like filling can be produced using gaussian noise. I have no idea of how to do implement that with tikz/pgf though.

Best Answer

It takes ages.

\documentclass[tikz,border=5]{standalone}
\usetikzlibrary{decorations,backgrounds}
\pgfkeys{decoration/.cd,
  iterations/.store in=\pgfdecorationiterations, iterations=75,
  radius/.store in=\pgfdecorationradius, radius=0.25pt,
}
\pgfdeclaredecoration{chalk}{draw}{
\state{draw}[width=\pgfdecorationsegmentlength]{
\pgftransformxshift{0.5\pgfdecorationsegmentlength/2}
\pgfmathloop
\ifnum\pgfmathcounter>\pgfdecorationiterations
\else
\pgfpathcircle{\pgfpointpolar{rnd*360}{rnd*\pgfdecorationsegmentamplitude}}%
{\pgfdecorationradius}%
\repeatpgfmathloop
}}
\begin{document}
\begin{tikzpicture}[background rectangle/.style={fill=black},
  show background rectangle, chalk/.style={fill=white, decorate, 
  decoration={chalk, segment length=1.5pt, amplitude=3pt}
  },looseness=0.25]
\path [chalk] (1/8,2) -- (0,1/2) arc (180:315:1/2) (-1/2,3/2)
  to [bend right] (5/8,3/2);
\path [chalk, shift=(0:1)] (1/8,1) to [bend left] (0,0);
\path [chalk, shift=(0:3/2)] (1/8,2) to [bend left] (0,0)
   (2/3,1) -- (1/16,2/3) -- (2/3,0);
\path [chalk, shift=(0:5/2)] (0,1) to [bend left] (1,1)
   to [bend left] (0,0) to [bend left] (1,0);
\path [chalk] (-1,-3/4) to [bend left] (9/2,-1/2);
\end{tikzpicture}
\end{document}

enter image description here