Rounded Corners for images?

Dar Scott dsc at swcp.com
Tue Oct 10 03:16:33 CDT 2006


On Oct 9, 2006, at 10:32 PM, David Bovill wrote:

> Yes - but it seems a bit fragile. Or  that is it took a lot of  
> tinkering to
> set it right, and then I tried it on an existing group which  
> continas other
> objects as well as the graphic and image - and try as I can i can"t  
> get the
> same effect.

This will depend on the layers.  And remember to set the ink of the  
group to something other than srcCopy.

> Is there some documentation on this or can you explain why / what  
> grouped
> inks work?

If a group or card has a blend = 0 and an ink that is not srcCopy,  
then it has an alpha channel, and then acts as though adding  
parentheses in image math.

Here is a math oriented explanation:

Suppose "*" is the binary infix ink operator and it performs the kind  
of ink is that associated with the first parameter.  Suppose it is  
written like this a*b where a is a src control (or image from a  
group) and b is a dst image.  Suppose "card" and "stack" means the  
color/pattern of the card and stack, and "black" means a black  
image.  A group or card may have opaque false and in that case a  
transparent trivial image is used in its place.  Suppose "*" is right  
associative, that is a*b*c = a*(b*c).  Suppose objects of layers 3 to  
1 are a, b and c.  Then the resulting image like this:

      (a*b*c*card*stack)*black      if the card does not have an  
alpha channel
      ((a*b*c*card)*stack)*black    if the card has an alpha channel

Now suppose controls a and b are grouped and the group has an alpha  
channel.  The result would be this:

      ( (a*b*group)*c*card*stack ) * black       if the card does not  
have an alpha channel
      (( (a*b*group)*c*card)*stack ) * black     if the card does  
have an alpha channel

In this case, (a*b*group) is calculated separately to form an image  
that is processed with the rest.

The ink operator for the stack is fixed.  If the card does not have  
an alpha channel, a control with a transparent section can burn a  
hole all the way to black.  Otherwise, it burns a hole only to the  
stack background.

Now for something with less math.  It is like gluing pictures and  
cards onto a collage.  You work from back to front using the right  
kind of glue for each layer.  The group means that you glue some  
things together, put them in a clear envelope and then using the  
right kind of glue for the group glue that to your collage.


Those of the first batch of the new inks are called "structural" in  
the property inspector and are the well-established Porter-Duff image  
composition operators.  You can find info on these online.   
Revolution Porter-Duff inks are a variant (bug) similar to the  
variant (bug) used by Java2D which makes them less useful and can  
give surprising results.  I have seen these called clipped Porter- 
Duff operators (bugs).  This SVG article points out this variant  
(bug) and describes it:

     http://www.svgopen.org/2005/papers/abstractsvgopen/index.html#S10

This same article also is a good intro to the P-D operators.


The next lot of inks is similar to the blends available in  
Photoshop.  Those are described lots of places.

I hope this helps.  I have trouble explaining things.

Dar





--
**************************************
Dar Scott
Dar Scott Consulting  and  Dar's Lab
8637 Horacio Place NE
Albuquerque, NM 87111

Lab, office, home:  +1 505 299 9497
Fax:                call above first
Skype:              ask

http://www.swcp.com/dsc
dsc at swcp.com

Computer programming
**************************************





More information about the use-livecode mailing list