Can anybody help me with image tracing?

Hello,

I am new to Python. I just wanted to know if it is possible to trace images, as shown in the images below, using any Python script. I shall be very thankful for any guidance…

Probably not out of the box (no pun intended :upside_down_face:). I imagine that with the right 3rd party libraries and/or with your own additional code, it is possible.

So, can it be done? Sure. Do I know how to do so offhand and what libraries would be required? No, but at the very least an image library that allows you to process the pixels would be a good start (pillow or opencv).

It wouldn’t surprise me if someone has done this before, but you’ll likely need to do your own research to find what is available unless someone here happens to have had this need in the past.

I tried the OpenCV method and got this result:

Definitely not how I wanted. Can you please help me get result similar to the cat image? Thank you!

I cannot.

I was not promising that OpenCV has exactly what you need, only that something like that was likely going to be needed to do what you want, simply as an image manipulation library. I also have no idea what you tried exactly, but I also don’t have time to design a solution for you.

It seems there are multiple techniques being applied in your target image, and you will need to determine how to do each each one, contour tracing is only one of the them.

It is possible that you may need to employ multiple techniques, or design your own algorithm, but you will have to put in the research to determine that, unless someone else here already has the knowledge you need.