https://www.rapidtables.com/convert/color/rgb-to-hsv.html Doesn't work correctly with stamps using this method.
The dot in the middle is pen, so if you can't ever see it, then you've got a working algorithm. Much better one by @-Rex-Test- https://scratch.mit.edu/projects/347884403/