I'm trying to add a color cast to a grey, contoured button shape (defined by a vector mask), by overlaying it with an adjustment layer with a solid green fill and setting the blend mode to "multiply."
The shape layer has transparent pixels around the perimeter, so I would not expect a "multiply" operation to result in visible green there. But it does. That's no good. I need to export this image to a PNG with the transparency intact.
I can see that the green adjustment layer has a "Color Fill 1 Mask" channel, but copying the shape layer and pasting it into that mask channel doesn't seem to help. The display shows a very thin outline of the vector shape, but I can't appear to do anything with it.
What's the proper way to accomplish my goal here?
Clip the Color Fill Layer to the Shape Layer - press Opt/Alt and click between the two thumbnails when a little box and downward arrow appears, or right-click on the CFL's name in the Layers Panel and pick Create Clipping Mask.
An alternative is to not use a CFL and instead give the Shape Layer a Layer Style Color Overlay where you can choose the color and blend mode, too.
By the way, in general pretty much all the Blending Modes combine pixels with transparency to create opacity.
Since combining something with nothing has to be defined as soing something - and as you've seen there are ways to preserve transparency - it makes sense and is a logical extension of operations on pixels with partial transparency.
Do this experiment some time: Paint a fuzzy blob on an otherwise perfectly transparent layer using a soft-edged brush (i.e., so there's partial transparency at the edges. Now add a fully opaque Color Fill layer over the top, and see how that combines using all the different Blending Modes.
Mobius Strip wrote:
I'd still like an explanation for how multiplying by nothing gives you something, though...
Multiplying by color zero (black) yields zero (black). From PS6 help: "Multiplying any color with black produces black."
Multiply blending mode looks at the color information in each channel and multiplies the base color by the blend color. The result color is always a darker color. Multiplying any color with black produces black. Multiplying any color with white leaves the color unchanged. When you're painting with a color other than black or white, successive strokes with a painting tool produce progressively darker colors. The effect is similar to drawing on the image with multiple marking pens.
Nothing is being multiplied. The color is the color of the layer above alone.
There are pixels in the layer above, even though there are no pixels in the layer below. Why is it hard to imagine that would cause opacity?
In any case, it works the way it does, so you just have to get used to it. As mentioned above, clip the layer above to the one below if you want to maintain the transparency.
"There are pixels in the layer above, even though there are no pixels in the layer below. Why is it hard to imagine that would cause opacity?"
Because the final pixels are supposed to be the result of multiplying the pixels of one layer by those of another. In this case, there are areas where there's nothing to multiply by. I would expect the result of that to be no pixel. Yes, black equals zero, and these transparent pixels aren't black. But treating them as though they're white is arbitrary and should, at the least, be optional.
Thanks for the feedback. Using a color-overlay effect on the shape layer works perfectly.
You have a different conceptual view from what Photoshop actually does with its layer combination logic. Try not to oversimplify things.
When you set the Blend mode to Multiply, transparency is not multipled. The color is. As I have said, Transparency is a separate animal, and there's simply no expectation to multiply transparency. It just doesn't work that way.
I happen to have a special insight in that, while not having programmed Photoshop itself, I have coded software that combines layers of data (including transparency) in my own products. It took me a while while creating the combinational software module before everything clicked and I saw how it has to work.
If you ever want to bake your noodle, look up "pre-multiplied alpha" some time.
"When you set the Blend mode to Multiply, transparency is not multipled."
Exactly. I wouldn't expect it to be. As you say, the COLOR is supposed to be multiplied, and there isn't any color in the transparent region to multiply by. Reasonably expected result = zero. It would make sense to offer a toggle to treat transparent pixels as black or white, but in the absence of that option I'd expect them to be treated as zero and argue that it's more useful than always generating a colored rectangle the shape of the layer.
I've also reverse-engineered (sometimes with the help of public-domain references) half of the major Photoshop blend modes and incorporated them into compositing software so we could import Photoshop files. Mimicking what Photoshop does is different from doing it right in many cases.
And yeah, premultiplication causes real problems for people who don't know what they're dealing with when compositing. Pre-multiplying was just a bad idea that unfortunately we have to live with. Kinda like interlacing.
Thanks for the reply.
Transparency is not a color, nor is it expected to be multiplied.
A layer that happens to be over the top of other layers doesn't have transparency of its own, and conceptually I can't see why you'd expect the transparency of anything below to have any effect on the result of combining in a new, fully opaque layer.
We could debate what's "reasonably expected" or "doing it right" all day, but at the end Photoshop does what it does and we all just have to get used to it.
Europe, Middle East and Africa