I wrote a plugin long ago to help me in coloring comic pages:
1: Outline image darkened a bit (to minimize gaps) and converted to two bit indexed black and white. 2: Multifill filter fills with random colors. 3: Outlines removed with flatten filter.
Random colors replaced. Outline added back as a layer in multiply mode. Shading applied.
I wrote this in 2013 and I regret not having shared it, the only other option was a very slow script on the Gimp Registry. I wrote mine with its own logic not using any Gimp features except access to image data. I wrote it in C and it's fast, even on old 32 bit machines. But I never dared to show my C code and I couldn't have compiled anything on other platforms but Linux.
Only very recently I found out by accident about the low level access to gimp images with Python. I ported the code just to try. The result is not as fast, but it's quite reasonable, taking a few seconds and not minutes or hours to finish.
My script is dumb, it can't find gaps or merge small areas with the surrounding ones, someday maybe. I know Gimp now has filling with line art detection and there's also an advanced "smart coloring" GMIC filter. But the workflow with line art detection is not great for me, I have to work faster. And being Qt based, gimp-gmic requires that I install 44 packages and use extra 107 MB of disk, versus my tiny plugins that only take a few Kb.
flattingtools.zip (Size: 1.85 KB / Downloads: 8)
The flatting tool (edge removal) is copied from the one written by Rob Antonishen that uses the dilate filter, in this case my code would be slower in python.
1: Outline image darkened a bit (to minimize gaps) and converted to two bit indexed black and white. 2: Multifill filter fills with random colors. 3: Outlines removed with flatten filter.
Random colors replaced. Outline added back as a layer in multiply mode. Shading applied.
I wrote this in 2013 and I regret not having shared it, the only other option was a very slow script on the Gimp Registry. I wrote mine with its own logic not using any Gimp features except access to image data. I wrote it in C and it's fast, even on old 32 bit machines. But I never dared to show my C code and I couldn't have compiled anything on other platforms but Linux.
Only very recently I found out by accident about the low level access to gimp images with Python. I ported the code just to try. The result is not as fast, but it's quite reasonable, taking a few seconds and not minutes or hours to finish.
My script is dumb, it can't find gaps or merge small areas with the surrounding ones, someday maybe. I know Gimp now has filling with line art detection and there's also an advanced "smart coloring" GMIC filter. But the workflow with line art detection is not great for me, I have to work faster. And being Qt based, gimp-gmic requires that I install 44 packages and use extra 107 MB of disk, versus my tiny plugins that only take a few Kb.
flattingtools.zip (Size: 1.85 KB / Downloads: 8)
The flatting tool (edge removal) is copied from the one written by Rob Antonishen that uses the dilate filter, in this case my code would be slower in python.