1

I'm new to Android Graphics and would appreciate if you can advise an algorithm to color particular part of image with outlines. I would like to create similar to this application.

I should be able to fill in parts of the image with colors, or use freehand tool to paint, but it should not go outside the outlines.

Should I use any image recognition tools to track black pixels for example?

I can also use predefined images only. I know I can convert each part of it into vector format. Will it be helpful?

Any tutorial references or example code would be highly appreciated.

Gyuzal
  • 1,581
  • 10
  • 52
  • 99

1 Answers1

1

You could look for connected-component-labeling. It basically assigns a label to each pixel where the label depends on the color of the neighbour. A description and implementation (though not in Java) can be found here: http://www.codeproject.com/Articles/336915/Connected-Component-Labeling-Algorithm. An implementation in java might be found here (https://github.com/klonikar/connected-components-labeling). I didn't check it though.

When you selected the pixels that you need, you can color them as described here: how to change the color of certain pixels in bitmap android

Community
  • 1
  • 1
AljoSt
  • 439
  • 4
  • 19