skip to Main Content

When you draw by a brush in Photoshop it doesn’t overlap itself until you release mouse button and press it again.

I found these images, that let me explain myself better.
Now my drawing works the right way, but i want them to work like the left one.
enter image description here

If it’s even possible I wish It wouldn’t overlay itself even after user releases finger and start drawing again, but I’ll go with basic photoshop-like brush.

I guess creating brush that never overlap itself is simmilar with creating an eraser, in some way, but i maybe wrong.

I need code examples in swift/obj-c.

2

Answers


  1. Chosen as BEST ANSWER

    The main idea to achieve this is to track a CGPath for a finger painting and redraw the whole picture every time it changes.

    So you create a CGPath and store it in memory. Then when user draws something you add this path to existing one and redraw the whole new combination of paths. This allows brush to always have constant opacity and overlay itself.


  2. I am not sure why you tagged this as iOS, but try putting on a new layer!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search