Alpha question

Hey All,

In trying to build a brush that utilizes inhibitors, I ran into an interesting occurrence.  I used the following image created in photoshop with an embedded alpha channel:


When I used the image as a source image in Studio Artist 4, the black areas seemed not to be recognized by SA4.  The image did not have a black background saved in the final image--that is the only image visible when the .psd was created were the center circle and the outer ring.  I used the photoshop video action "alpha channel from visible layers" to create my alpha channel.  I did not include a separate black layer for a background.


When I pulled the image into SA4 to manipulate, (canvas->erase to->source image) the canvas remained white.  The alpha channel is recognized--I could set the region selection to the source alpha, but everything in the frame is white:



The brush I'm building is based on using path start inhibitors (white only).  However it doesn't respond the way that I intended as the entire frame is white.  I've figured out some work arounds for this problem, but I'm wondering if I'm missing turning on a flag or doing something wrong here.  My expectation is that I could bring in an image with an alpha channel set it to the canvas image and have it show up.  Is this correct or incorrect?  If its incorrect, how should I build my images so I can do just that?


(For context, I built the image used in the examples with alpha because I also want to use it as an image brush).



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

Join Studio Artist

Email me when people reply –

Replies

  • You'd want to flatten the photoshop layers before saving an output image, so that could be part of the problem. You just want it to be a 32 bit ARGB image, nothing else. TIFF's also a useful output format to try if you run into problems, and will also let you embed an alpha channel.

    What did the alpha channel part of the image look like?

    As far as how an image is going to work as a source brush in paint synthesizer classic, anything in the image pure white (255) is going to mask out (nothing will draw in that part of the nib). Anything pure black (0) will be full on as far as how the brush is used is concerned.

    The spatial gradient in the source brush image from the values 0 tp 254 is going to determine the mix of 'fill from' and 'fill to' signals for the normal 'blend' fill option used in the paint fill setup control panel by many paint synthesizer presets.

    So this original historic design enabled you to avoid using an alpha channel for masking and simply work with a normal image file define a source brush.

    Any alpha channel in the source brush image is going to be ignored unless you use a brush type that specificly works with it, like Source Alpha Brush brush type. If you use that, then the embedded alpha channel would be used for the brush nib based computations as opposed to the source brush image. But for that brush type, the values in the alpha channel would work like you would expect them to in a conventional sense, with 0 (black) being full off, and 255 (white) being full on. Note that this is the inverse of the normal source brush, where black in the brush image is actually defining where color will be applied (with paint fill from set to paint color and paint fill to set to canvas image, and fill option set to blend). Of course since the paint synth is totally reconfigurable, you can change the way it works, inverting the operations, using different fill options which use the brush image in a totally different way, etc.

    If i was going to rewrite everything from scratch today i'd probably have it work differently, but the classic paint synthesizer started from it's humble beginnings over 10 years ago at this point in time and will always use the setup described above to maintain compatibility with existing paint presets.

    And to be honest, alpha channels can get so confusing in most programs, especially how they get passed around (or not) in image formats like photoshop, that being able to define the masked part of the brush by just specifying pure 255 white in those areas is an easy way to work.


    For those of you who don't know or forgot or are totally confused at this point, it's probably worth a slight side digression into how the paint synthesizer works. The following is from p67-68 of the User Guide pdf.

    The Paint Synthesizer is based on a model of applying dabs (also sometimes referred to as nibs) of paint to the Canvas along a path. How the dabs are applied to the path and the overall shape of the path itself can be extensively modulated under interactive control.

    A path can either be defined manually using a pen or mouse, au- tomatically by a path generation algorithm, or by a hybrid process that combines manual drawing with on the fly auto path generation. Collections of recorded Bezier paths can also be accessed and modu- lated or transformed in real time as a further source of automatic path generation.
    A dab of paint is generated from a dynamic computational brush and dynamic computational paint. Both dynamic elements ( brush and paint ) can be changing under your interactive control, or the Paint Synthesizer may be modulating them on it’s own.

    The dynamic brush is generated from a Brush Source and a Brush Type computational generation algorithm. Brush Modulation pa- rameters specify additional adjustments to modulate the dynamic brush size, orientation, and texture. Each time the brush is used to ap- ply a dab of paint, it could be the same or totally unique. It all depends on how the Paint Synthesizer editable parameters are configured.

    A dab of paint is generated at a particular path location using the current dynamic brush and two Paint Fill sources. They are called Fill From and Fill To. The dynamic brush, the two paint sources, and several Fill Option parameters act together to generate a unique dab of paint to be applied at a particular path position.

    A simple dab of anti-aliased paint could be based on a single color as the Fill From source and the Canvas as the Fill To source. More complex and organic dabs of paint or 3D paint effects can be con- structed using Brush Loading. Brush Loading allows for a wide range of sophisticated image generation and processing algorithms to be dynamically executed on the fly as you draw to create richly textured and organic paint dabs.

    The dab of paint is then applied to the Canvas with a particular paint Fill Algorithm. Different Compositing and Masking options can be chosen for the particular painting algorithm. The application of the dab to the Canvas can be modulated interactively or algorithmically.

    Certain painting Fill Algorithms that Mix may spawn a second inter- acting Paint Fill process with it’s own Compositing and Blending parameters. The power of this sophisticated paint application process allows for total flexibility in creating unique and different paint visual looks and tactile feels. A Paint Patch can be built to emulate traditional media or to create something totally wild and new.



    OK, now back to working with a source brush containing an alpha channel. A good one to test is the Butterfly Alpha Brush.psd file in the Brush folder we provide. It's a photoshop file, it contains an image of a yellow butterfly on a white background, and it also has an embedded alpha channel. The actual image looks like this displayed in the studio artust canvas (it's 48 x 34 pixels so it's small).


    The alpha channel looks like this, as seen by using the erase to source alpha option:


    Now if you load that particular image into the studio artist 4 source area, it will look like this:

    So hey, that looks somewhat different than the actual image, what's the deal? Any source image that contains an embedded alpha channel will actually alpha mask when displayed in the source area. (I don't know whether this could be considered a feature or a bug, it should probably be switchable, but right now you have to live with it in v4.)

    Now, to use this image containing an embedded alpha channel as a source brush we need to run the FIle : Paint Synthesizer : Image Brush menu to load it as an image source brush:


    SO, let's setup the paint synthesizer with a simple conventional paint fill setup preset as shown below:


    SO, i'll compare drawing with the source brush type and the source alpha brush type below:

    In both cases, i painted a single brush nib and a path (remember paths consist of a series of brush nibs applied to the canvas). And remember as explained above from the user guide that the source brush defines a brush nib that is then filled with paint and then applied to the canvas (as opposed to just drawing directly with the source brush image like most other paint programs).

    So, using the source brush type we get a light color butterfly when the paint nib is replace composited onto the canvas during drawing. Why is it light? Well after reading the description of how the source brush works above, you know that the butterfly image is going to be a gray luminance color in the area of the butterfly, so it will mix between the fill from paint color and the fill to canvas, so you get partial blend of paint color and the canvas. And the white background will act as a mask, which is why we get the butterfly shape for the single nib application of paint.

    The second set of single nib and painted path shown in the canvas image above is using the source alpha brush, so note that we get a full color nib and a full color painted path of repeated red color nibs on the path.

    Now, suppose we want to use the embedded alpha channel to define the nib but the actual source brush image to define what is painted. The most typical reason why you might want to get into this whole embedded alpha channel thing in the first place. We go to the Paint Fill Setup control panel and make the following changes:


    The single nib and painted path will now paint as follows:

    Note that the butterfly image is being painted in the nib, and the embedded alpha channel is being used to define the shape of the nib.
This reply was deleted.

Is anybody making a copy of all the material in the Tutorials Forum

Since the Forum is going away in June, has anyone started to make a copy of all the stuff in the Tutorials forum?I've made copies of some of the tutorial material on the main site, but haven't looked at the Tutorial Forum yet.I'm going to continue copying as much as I can for my own personal use anyway, but if anyone else is doing it, or has already started doing it, please let me know.Maybe we can co-ordinate our efforts. ps can't ..... believe John, would let this happen without so much as a…

Read more…
1 Reply · Reply by Thor Johnson Apr 13