There is a very interesting current ongoing forum discussion focused on creating WPAP Stylistic Artwork.

In it, i mentioned in passing that it's fairly easy to automatically convert a manually drawn black sketch on a white background into a set of fully colored regions. And that Studio Artist can do this automatically. As opposed to alternative approaches like using a program like Illustrator to tediously to the task manually, re-drawing your individual design sketch regions in one by one. Which was how we watched someone do it in a 23 minute long video that actually skipped over most of the manual drawing work needed to pull it off when approaching the task using other programs. So the complete task done that way would take much longer.

Keep in mind that i am not great at manual drawing, and i'm not even going to really try to be for this tutorial. So don't pay attention to the quality of my drawing (which is terrible), just focus on the series of steps i'm taking to get from point A to point B. How to take your rough sketch and auto-convert it into fully colored region.

There are a few things that are very important to keep in mind if this is going to work properly. You want a solid colored background, and a different color solid colored paint tool. And you want the paint tool to have hard edges, not soft edges. And you don't want any color randomization turned on associated with the paint tool you will be using for making the rough sketch.

I used a solid white background for my drawing canvas. And a solid black thin line paint tool.

I also used the source onion skin feature available in Studio Artist as a visual aid for my drawing. You can turn on the Source Onion Skin using the Canvas : Onion Skin: Source menu flag. If it's checked, then it's turned on. 

You will also notice in the menus above that you can use the command t hot key menu to toggle the onion skin on and off during your work. As opposed to manually doing it via running menu commands.

So i started by erased the canvas to white.

If you don't know how to do that, then you really need to read this tip on erasing the canvas.

I then selected a paint preset that paints with a thin black pen line. I picked the Thin Black Pen preset in Default : Utility. I'm using original V4 preset categories, not the later reorganized V4.04 ones.

As it turns out, i initially picked the wrong paint preset to do this, one that had soft edges as opposed to hard ones. But we'll follow what i actually initially did to show why this leads to less than perfect results, and how i then fixed that by using a correct alternative black pen preset with hard edges in my second attempt.

So below is my really bad attempt at doing a rough sketch using the source onion skin as a guide. Again, this is to show you the steps involved in the whole process. So please ignore how bad the visual design and execution of my sketch is.

You can see the source image transparently displayed in the canvas, because the source onion skin is turned on. If i toggle it off, then this is what the actual canvas looks like.

So the onion skin is not actually in the canvas, it's like a temporary partially transparent layer Studio Artist places there that you can use as a visual guide for your manual drawing.

Studio Artist also have all kinds of more advanced onion skin features for people who do traditional hand painted animation. Look in the Users Guide for more information on what all of those are if you are the kind of person who would want to use them.

So now i have designed my rough sketch. Since you the reader will actually know how to draw well, your rough sketch will look much better than mine. And if you are actually trying to emulate the WPAP style, then you probably will carry through the various line segments all the way across the canvas. It seems like the point of that particular artistic style is to build some kind of global geometric patterning into your sketch, along with also reproducing source image features in a stylistic way. And the interaction of those 2 design goals is what leads to a successful WPAP regionization of the source image.

I'm not successfully achieving either of those design goals, but again, that's not the real point of this tutorial. I'm trying to show you how you can take a rough sketch and then auto fill in solid color into all of the regions defined by your rough sketch.

So, what have i done by drawing solid black lines onto a solid white surface? I have broken that solid white surface up into a series of separate white regions. Each individual white region is fully surrounded by black lines. So i don't necessarily have to draw in the full outline of a given region. It just happens due to the intersecting nature of individually drawn black lines.

At this point, there are a number of different automatic techniques one could use in Studio artist to automatically fill in those individual white regions defined by my rough sketch.

Keep i mind that if there is a tiny hole in the black line somewhere, then that means the 2 adjacent white region areas are really still the same region (because of the hole in the line). So individual regions need to be completely enclosed. Holes or spaces will lead the automatic fill in algorithms to consider them to be parts of the same much more complex shaped region.

I decided the use the Flat Region Colorize image operation effect to do my automatic filling in of my inherent white regions created from the black lines that make up my rough sketch.

And the settings above gave me the result below.

Note that all of the individual flat colored regions in my canvas were filled in with solid color. Including my black pen strokes i used to build up my initial rough sketch.

If you don't want the black pen lines to fill in, an easy trick to achieve that is to turn on Min compositing (set the Composite parameter in the control panel above to Min).

Then you get the different automatic fill in result as shown below.

Note that the black lines now stay black. As opposed to being filled in with color.

Now i mentioned above that i made a mistake when i initially selected my original thin black pen preset i used to do my rough sketch. Because it actually has soft edges, rather than hard edges. So the thin black line it draws is anti-aliased, as opposed to aliased.

Normally an anti-aliased black line would be the optimal choice for creating a rough sketch. Because the line quality is visually superior to a preset than draws a pixelated aliased black line. But for the task we are undertaking here, you want the reverse. You really need that pixelated solid black line, with no anti-aliasing in it.

And you can see why in the 2 images above. Because each pixel associated with the soft edge of the black line is considered by the automatic fill in flat colored regions algorithm to be a separate region of it's own. So you see a lot of visual noise at the places in the canvas where the black sketch lines were, because every pixel in the soft edge of the line is considered a new region by the automatic algorithm that fills in flat colored regions with new coloring.

I left in my original mistake and what it visually produced in this tutorial on purpose, because if you don't understand the concepts i just explained above, you are never going to be able to make it work, and will then wonder why. So learn by my mistake, since you might make the same one the first time you try this. And if you do, you will see fine color noise artifacts in the resulting colored regions just like you see in my initial attempts above.

The way to fix this is to use a correct paint preset. One that actually has hard edges, not soft edge mixing in of the canvas like an anti-aliased drawn line would have.

We will continue part 2 of this tutorial in the next post, where i'll do it all over again using a different black pen preset that has the correct properties needed for this kind of approach (hard solid color edge, no anti-aliased drawing).

You need to be a member of Studio Artist to add comments!

Join Studio Artist

Email me when people reply –

Replies

  • a more general case- was presented Here

  • Ok, in part one of this tutorial i showed you the basic steps needed to take a rough black pen sketch made on a solid white background canvas, and then automatically fill in all of the inherent regions defined by that rough sketch with different solid colors. And i also showed you a common mistake you might make when doing it.

    The mistake was that i used an anti-aliased black pen preset to do my drawing (soft edged black line). I needed to use a different black pen sketch preset that has hard edges (no anti-aliasing, but instead very pixelated solid edges associated with the line being drawn).

    So, i selected a new black pen preset. I picked one that has a brush size of 1 by 1 pixels to get across another fine point of using the Flat Region Colorize ip op effect, that we will get into below.

    So here's a partial section of my second rough sketch, this time made with the new black pen paint preset that uses the thinest solid black line you could possibly use. Just 1 pixel wide, with no anti-aliasing involved in how the line is rendered into the canvas. Very pixelated look to it.

    2472669739?profile=original

    You can very clearly see above that the line is solid black (no soft edges), and it's very thin, just 1 pixel wide.

    Now if you do decide to use a 1 pixel solid black line for this whole process, then you need to slightly modify the Propagation control in the Flat Region Colorize ip op effect so that it properly deals with that. I used the settings show below.

    2472669873?profile=original

    Note that the Propagation has been changed from All to No Diagonal. If you use a 1 pixel wide black line for your drawing, and you use the All setting, it's not going to work properly. Because the algorithm that figures out the individual regions is going to just pass right through any diagonal sections of that 1 pixel thin line while it's doing that automatic process. By setting Propagation to No Diagonal, i prevented that from happening.

    You could also just use a 2 pixel black line width, and then you would't have to worry about this. But i did what i did above specifically to point it out to you. Because again, when you are first started out, you might do it and use the All propagation setting and a 1 pixel wide black pen, and then wonder why it didn't work properly.

    Using the rough sketch above, and the Flat Region Colorize ip op settings shown above, i got the resulting automatically filled in image below.

    2472670228?profile=RESIZE_1024x1024

    Note that the Composite control was set to Min, whihc allowed the original black sketch lines to continue to show through. As opposed to them also being considered flat colored regions by the effect, and then auto-filled in with a new color.

    I also set the Variation control to Recolor RndHue Mean. So now the automatic coloring of each region tries to reproduce the associated original coloring of the source image art that local spatial location, but also randomizes the hue of that color when it fills in the region.

    Now suppose you hate those black line, and want to automatically get rid of them as well.

    As it turns out, that is quite easy to do as well in Studio Artist.

    And there are several different ways to do it.

    I used the Geodesic Interpolation ip op effect to do it. Using the settings show below.

    2472670247?profile=original

    Running the effect as show above on my automatically colorized rough sketch shown above leads to the result below.

    2472670315?profile=original

    Note that the black sketch lines have now been automatically scrubbed out of the canvas.

    The Geodesic Interpolation ip op effect is designed to automatically remove whatever the background Color control in the effect is set to, and fill in those background colored areas of the canvas by extrapolating the existing canvas coloring surrounding the background area into that area. So with the settings shown above, all pure black regions are removed and filled in with extrapolated color from the surrounding areas.

    At this point, some one is probably going to chime in and say something to the effect of, 'it's great you auto-filled in your rough sketch with color automatically, but i want to do that so that i get nice vector regions with anti-aliased edges. And i want more rigid geometric line structure'.

    And in fact you can do that.

    There are at least 2 other ways you can do what i did in Studio Artist above, take a rough sketch with the properties we defined (solid color background, different solid color sketch lines, hard edges for the sketch lines),and auto fill in the inherent regions defined by the rough sketch lines with solid color. And the solid color could be anti-aliased vector colored regions if you want them to be that.

    We could use the Vectorizer to do it.

    Or we could use the Paint Synthesizer to do it.

    Both fully automatically.

    So i will show these other approaches off in some additional tutorials posted here. Those will appear later today, or maybe tomorrow. As it is, there is probably already a lot of new information here for some 'just getting started wit Studio Artist' people to absorb in what i have already posted.

    And again, i want to point out that the effect design paradigm i discussed above can be used in all kinds of other ways than the particular task we are trying to do here. It's very useful for designing all kinds of different visual effects. And in fact is used in some factory PASeq presets we ship with Studio Artist.

    • Excellent explanation John.That is the essential knowledge we need-hopefully-to be more creative.

      I couldn't find the thin black pen preset.Instead I've found a Pencil preset,but is taking the colors of the source. My version is 4.05.

    • Here's a Thin (1 Pixel) Black Line hard edged paint preset for V4.

      Thin (1 Pixel) BlackLine.zip

    • So how does one take a flat color region raster image that has hard pixelated edges (like the one i generated above) and turn it into essentially the same image, but now composed of nice anti-aliased colored vector regions.

      That could also be output as an eps or svg vector file if you want to do that.

      And then potentially be re-rendered into any arbitrary raster resolution for printing purposes. Or maybe you are going to use the actual vector curves (bezier curves) in another vector editing program like Illustrator, as a part of some larger project.

      One approach is the use the Studio Artist Vectorizer.

      The Vectorizer is a very versatile operation mode in Studio Artist. It can be configured to generate all kinds of wildly different stylistic effects. But fundamentally, it was designed to convert a raster image into a vector image. And probably the most fundamental thing you can do is take a raster image that is already composed of a set of flat colored regions, and convert those flat colored regions into flat colored vector regions.

      So i quickly threw together a simple vectorizer preset to take the last canvas image from the previous part of this tutorial shown above (the one where my rough sketch had been automatically converted into colored regions and the original black sketch lines were also automatically removed from it), and automatically convert that into anti-aliased vector regions.

      2472669593?profile=original

      I used the Flat Input option for the Main Technique parameter, as shown below. You are looking at the Generation control panel of the Vectorizer. Main Technique is set to Flat Input.

      2472669635?profile=original

      Note that the Vectorizer Source parameter is set to Current Layer, as opposed to Source. I did this because i want to take my flat colored region raster canvas image and convert that into a vector representation of that raster canvas.

      And i want to do it in a way that doesn't add any extra stylization effects, or re-coloring effects, or radical shape modification effects.

      Because i don't want to modify the image other than convert it from raster to vector, note that all of the various Filter options in this control panel are turned off. Because they would modify the input in some way if they were turned on, and for this particular application of the Vectorizer we don't want to modify what is coming into it in any way. If we were doing some sort of stylistic vectorizer effect, then size pruning, or joining similarly colored image, or cleaning up noise in the input source might be a desirable thing to do.

      2472669877?profile=original

      Also, because i really want anti-aliased vector drawing to take place in the Studio Artist canvas when running the effect, i made sure the Canvas Render Option parameter in the Drawing control panel of the Vectorizer was set to Vector Antialias. As opposed to Pixel Raster Fill.

      And i turned off any stylistic options available in the Drawing control panel as well.

      An interesting educational experiment, if you have some time to wait for the Vectorizer to work really hard to generate the effect, would be to change Vectorizer Source to use the Source image instead of my flat colored region raster canvas image (which i did by setting it to Current Layer). With the rest of the Generation control panel settings left as they are setup above.

      Because if you are using the Flat Input technique to process a normal real world source image with a lot of varying tone gradation in it, then it is going to essentially view every little pixel in that source image as a separate colored region to generate a vector to represent. This is assuming you have a normal continuous tone colored source image.

      If you had a different source image with a face on a solid colored white background for example , then the solid single colored white background would be considered one region, and then all of the pixels in the continuous tone smoothly shaded face would be broken down into individual vectors.

      This is why the Flat Input technique is not typically used to precess normal real world source images. It was designed for special case situations like this example. Converting something that is already flat but raster into an accurate vector representation of that image.

      So, now you know 2 different ways to auto colorize quick sketches into full colored images. Both raster and vector. And you also learned how to convert any raster image composed of a set of solid flat colored regions into vector output. 

      Here's a hint, lot's of different image operation effects generate flat colored region output, so you can use what i described above to convert those ip op effects into vector output effects. And you could record both the ip op and the vectorizer pieces of the complete process into a PASeq, and then save that as a single preset file

      As i previously mentioned, you can directly output anything the Vectorizer is capable of generating to either eps or svg vector files. Here are some tips on generated eps output and generating svg output.

      As mentioned previously in this series of tutorials, another whole different fully automatic approach to converting a rough black on white sketch into colored regions would be to use the paint synthesizer to do it. You can use the paint synthesizer's path start regionization features to do that. We will dive into the specifics of how to do that in the next installment of this tutorial.

    • We've been exploring different methods to automatically take a black line on white backing sketch and automatically turn it into colored filled in regions.

      The end of the last tutorial section mentioned that there is another alternative approach to this whole problem we've been looking at in depth. Other than using the Flat Region Colorize ip op, or the Vectorizer flat input technique. Both of these options were previously discussed in earlier posts here.  

      The new alternative approach is to use the Paint Synthesizer.

      And a really cool feature built into it called path start regionization.

      In association with another cool feature called Region Fill as Brush pen mode.

      Normally, paint synthesizer auto-painting tries to emulate how a real world artist would paint with a brush, or draw with a pencil or pen.

      So it works by first generating a start point for drawing on the canvas, then automatically generating a paint path that extends out from that start point, and then painting in that auto-generated path with digital paint. And there are all kinds of different controls in the paint synthesizer to define exactly how a start point is chosen, how a paint path is intelligently grown out from that start point. As well as a ton of different controls to define the visual appearance of the digital paint itself.

      In this traditional drawing approach to the way the paint synthesizer works, a series of individual nibs of digital paint are then laid down along that automatically generated (or manually drawn in) path.

      And the visual appearance of those digital paint nibs can be extensively modulated by all kinds of different things, like different visual properties of the source image, what is already in the canvas, procedural randomization or texture generators, etc. So not only the color of the digital paint, but it's shape, it's perceived lighting, whether it smears the canvas or drips, etc can all be programed by how the various controls in the paint synthesizer are setup for a particular paint preset..

      2472669107?profile=original

      Above we see 2 simple examples of individual nibs of digital paint laid down along a manually drawn path. The individual paint nibs on the left are spaced 200% apart, the nobs on the right are spaced 20% apart. The specific nib spacing begin defined by the Spacing parameter in the Path Application control panel.

      2472688234?profile=original

      The paint synthesizer also contains 2 special Pen Modes, called Region Fill as Brush, and Auto Region Fill as Brush. These 2 pen modes work differently than other pen modes that follow the rendering model i described above. The model that tries to emulate how an artist would physically move a brush or pen on a canvas along a path to lay down paint or some other marking substance. Instead, these 2 alternative pen modes allow the drawn path to interactively define the shape of a single nib of digital paint.

      2472688308?profile=original

      So using either of these 2 special pen modes, the paint synthesizer has built into it the concept of painting in a complete colored region in a single path drawing step. If you are looking for a real world analogy for how these Region Fill as Brush pen modes work, they emulate an artist cutting a stencil and then filling in the cut stencil's interior shape with some kind of paint. Screen printing might be another real world analogy if you want to think about what is going on when using the Region Fill as Brush pen modes. You define a stencil by drawing a path (either manually or automatically), and then the stencil shape is filled in with digital paint.

      2472688381?profile=original

      Above we see 2 simple examples of single paths manually drawn in using Region Fill as Brush pen mode. So rather than seeing a series of paint nibs laid out along the path, the path itself defines one specific digital paint nib. A raster paint nib fill on the left, a vector paint nib fill on the right. In both cases, the shape of the paint nib (or region) was defined by the path the user manually drew in. If we were doing auto painting, then the path would be automatically generated by the paint synthesizer.  Note that the vector painted region on the right has smooth anti-aliased edges. While the raster fill region on the left is pixelated.

      The Path Start control panel in the paint synthesizer has a Generator control. And the specific Generator option you choose determines how the path start points are automatically generated. Path Start Regionization refers to a set of specific options available in that Generator parameter. They all include Regionize in their names.

      2472695263?profile=original

      The screen shot of the Path Start control panel above shows the Watershed Regionize option selected for the path start Generator. It is one of the many path start regionize options available in the Generator popup. Because Max Stroke is set to 100, 100 regions would be generated based on the specified Watershed Regionize generator algorithm when the action button was pressed with this particular Generator setting.

      Path Start Regionization generators work differently than normal path start generators. What they do is automatically break up the canvas into a set of automatically defined regions. Many of the different ones available do this by intelligently analyzing the source image in some way, and then building the automatically generated region shapes and their positions in the canvas off of this intelligent analysis process. 

      So in addition to defining a start point, any of the path start regionization generators also define a complete set of region paths that can totally cover the entire canvas. This is why they can seem to not be doing anything for a little while when you use one and hit the action button. Because they need to do a lot of intelligent thinking and analysis of the source image before painting can actually begin.

      Again, if you are looking for a real world traditional art process analogy to what is going on when you use a path start regionization paint synthesizer preset, it's like the paint synthesizer generates a complete set of stencil screens that cover the entire image. So if you were doing multi-color screen printing, you would build a set of different stencils for each color you want to print with. And then you overlay those one by one and ink them to build up the complete multi-color screen print.

      In addition to the path start regionization generators that intelligently analyze the source image, there are a few that can take an existing image composed of flat colored regions and just use that as the set of 'stencils' that will be used for automatic painting. So, in the context of this particular tutorial, we want a path start generator that takes our existing black line sketch on a white background and then converts that into a set of path start regions.

      There are several different ones we could use. One, the Flat Region Canvas as Regions option for the path start Generator, directly uses the contents of the canvas to define the stencil like drawing regions. So every individual colored region in the canvas would become a drawing stencil. Including the black lines in the context of this tutorial sketch.

      The one i used instead was the Selection as Regions -Full On Only option for the path start Generator. This takes the current contents of the selection buffer, analyzes it, and then uses every individual region in the selection buffer that is colored full on as a region to paint in.

      Full white (255 value) pixels in the selection buffer are full on, full black (0 value) pixels in the selection buffer are full off. Since the selection buffer is an 8 bit single channel image buffer.

      So here's my rough sketch that i used in the previous examples. The previous posts explain how it was generated. And again, it's just something simple i threw together quickly using my very rudimentary manual drawing skills to use as an example for this tutorial. You of course will be able to create a much more artistic sketch of your own when you try this. 

      2472669739?profile=original

      So, the first thing we need to do is to take this rough black line sketch on a white background image (which is currently in the draw canvas), and put it in the selection buffer. I used the Canvas : Selection : Set to : Canvas menu command to do that.

      2472695519?profile=original

      So now my black lines on white sketch image is also the current selection image.

      Remember, the black paint lines in your rough sketch act to break up the white backing into individual regions, where each region is completely enclosed by black pen strokes.

      What if i have a color image you might ask, what happens then if i run the above menu command. The answer is that the Green color channel for your color canvas is put inside of the selection buffer. The Green channel is used because it's a rough approximation of the actual color image luminance.

      I then built a custom paint synthesizer preset that would use path start regionization to paint in all the individual full on white regions in the current selection buffer.

      2472695657?profile=original

      When using this specific generator option, the Max Stroke setting is ignored. The number of regions drawn will be the number of separate full on (ie full 255 white pixel valued) regions that are in the selection buffer when you press the action button.

      I also setup the Pen Mode so that it used the Region Fill as Brush option.

      2472695959?profile=original

      When working with a path start regionization path start Generator, there is a specific setting for the Path Type in the Path Shape control panel that you would typically want to use. It's the Path Start Regionize option shown below.

      2472696026?profile=original

      Because we want to fill in each path start region using the region fill as brush pen mode acting like a stencil, i set the Region Pattern Type to Outline1.

      There are many other options available for the Region Pattern type when working with the Path Start Regionize path type. Many of them work to define various hatching patterns that can be used to paint in the interior of the stencil area defined by the path start regions. Outline1 just generates a clean outline path for the region. It generates no additional interior hatching or other additional patterning detail in the automatically generated path created for each region.

      The Paint Color Source control panel defines the color of the automatically generated digital paint. I used the settings below.

      2472696761?profile=originalThese settings took the local source color for each region, and then transformed it to have maximum color saturation while adding some randomization to the region color's hue. The region color's luminance will track the actual source image coloring in the local spatial area in the source image associated with each region.

      So these settings will artistically stylize the individual region colors in a WPAP aesthetic like way, high saturation, random hue, while maintaining the local luminance of the original source image.

      I also setup the paint synthesizer to use a vector paint preset, by setting up the appropriate controls in the Vector Output control panel. So each region would be filled in with anti-aliased vector paint. I setup the Rim size of the vector paint to be 4, so that larger rim size would overdraw the regions enough to fill in the blank spaces associated with the original black lines in my original sketch that defined the regions.

      And you can see the results of this custom paint preset below.

      2472697100?profile=RESIZE_1024x1024

      So once again, all of the individual regions defined by the original rough black line sketch on a white backing were automatically filled in with vector paint. And once again, i could record all of this in a PASeq, and then run one of the Action : Generate eps or svg from PASeq menu commands to generate an eps or svg vector file, if that was what i was ultimately looking for.

      Now in all of these examples using my crude rough sketch, you may have noticed that the interior detail of the right eye was never filled in with it's own unique coloring. It's missing in all of the automatically filled in examples.

      Why is that the case?

      Let's zoom into the facial part of my rough sketch associated with the eyes.

      2472698538?profile=RESIZE_1024x1024If you look very carefully at the interior shape as drawn inside of the right eye, notice that the black pen line does not completely enclose that interior shape. There is a pixel missing in the black boundary a the bottom left side of that hand drawn shape. Because the drawn shape is not completely enclosed by black pen, the automatic region generation algorithms consider it to be a part of the larger main right eye shape it is inside.

      So i left this bug in my rough sketch around to use an example to bring home the fact that all of the individual regions need to be completely enclosed, or they will not be considered separate regions when analyzed by the automatic algorithms we've been discussing that detect and then fill in individual flat colored regions in an image.

      Because, again, it's a common error to make, so you may very well run into something similar the first time you try a project like this.

    • Very clear.I was thinking in digital stencils without knowing that SA already has this technology .This kind of deep oriented tutorials are extremely useful. 

    • Thanks John for this excellent explanations and tutorial ! We still have much to learn.....

This reply was deleted.