
Procreate app is truly remarkable and a game-changer for everyone who does digital illustration as a hobby or as a profession. Instead of crayon textures you could have neon glow, stars, particle effects, and just about anything you can imagine.Already installed the Procreateapp? Great! Let’s get started. Keep in mind once you master this approach you can draw with anything. Hopefully this was clear enough and gives you some ideas. Unfortunately, setting up OpenGL adds a ton of code and can be very confusing.
If your familiar with OpenGL, you can get a good performance boost even for 2D because it can manipulate the "splotch" source images, offscreen rendering, and layering with a lot less code then you would have to do in CoreGraphics. This will allow you to redraw the entire piece with just a few transparent images, instead of thousands of little "splotches" every time. You can convert the "segments" from (3) into a single image by rendering them to an off screen buffer. Record your path, (x,y), size, "splotch" choice, and color continuously as the person is dragging, however, break it up into segments based on touch down/up or a maximum size, that way you can provide a step by step "undo" functionality. This prevents the crayon from becoming a solid color. Adding some very light grey-scale shadows into the images can give them depth and roughness that will be preserved even if you layer the images many times, and the grey scale won't be filtered out when you do HSV adjustments. This can be done in code or in your graphics program. You can use HSV (Hue-Saturation-Value) to create a range of color variations from a single initial set of images to get your various crayon colors. Some recommendations to get the best effect possible: You could get really clever with masks, patterns, gradients, and other Quartz methods, but the complexity to deliver what you want will probably out-weight the simplicity of the image approach. This is a very rough, but common approach to this problem. If the person draws back and forth, more will be laid down and you will get a darker (more solid/less transparent) color.
Then as the user drags their finger across the device record the path and draw these "splotch" images along the path. Photoshop, Fireworks, and many other drawing applications already have brushes and line styles for crayon like effects, so you can simply play around with a few of those on a transparent background to get some workable "splotches" (small round crayon looking transparent PNGs). The easiest implementation to get your head around, at least just getting started, would be to create a series of transparent crayon textures. The standard Quartz calls that you would use in drawRect: won't actually give you the crayon effect that your looking for using any default behavior.