Open b4zz4 opened 1 year ago
It looks like a useful feature that I am definitely interested in, but I may need to do some surveys first. So far, I cannot find an out-of-the-box solution. Clip Studio Paint has this function but it doesn't publish its algorithm. Its line width data cannot be exported as well. Inkscape can perform similar tasks with centerline trace, but it does not generate width data. There are also some deep-learning-based solutions in recent years but I haven't tried any of them yet.
The medial axis transformation method seems good for this operation: https://scikit-image.org/docs/stable/auto_examples/edges/plot_skeleton.html I will do some more investigations to see if it can be used for Grease Pencil.
This is similar, I think imagick is usually a popular library. https://legacy.imagemagick.org/Usage/morphology/#thinning_skeleton
I integrated scikit-learn and implemented this operator in a new commit.
The new version will be released in the next week.
I test it and it works perfectly
You probably had this idea. But scikit posterizes images in a very intelligent way. Plans of color or value can be detected in addition to lines. For already painted drawings
You probably had this idea. But scikit posterizes images in a very intelligent way. Plans of color or value can be detected in addition to lines. For already painted drawings
About color images, one of my idea is to realize a similar effect like FotoSketcher. But given the ongoing tasks, I guess it may take 2~3 months before I can start this one. Later in this or next week, I may write down a long-term roadmap discussing the functions I have in mind which have not yet been implemented.
Maybe my efficiency is too low, but I finally started working on the color image import.
I applied k-means to quantize the colors, and then used find_contours
to convert them to GPencil paths. It should work well with flat style images, but for realistic photos there will be a loss.
And the processing speed is kind of slow, which I cannot do much with.
I would like an option to add material instead of colored vertices.
I would like an option to add material instead of colored vertices.
I added this option today. It should work for a single image, but I need to make more changes in the future to support videos better. Now different video frames may generate different colors, which lead to too many materials.
Maybe you can create a unique palette for the whole video and generate associating the most similar color
It's an idea, but I don't really know how to create the program for this.