View Full Version : Photoshop mask question


gonzo
02-02-2003, 02:24 PM
Hi,

This has been driving me nuts trying to figure out in Photoshop. I used to use an alpha channel as a mask with my old software. What I want to do specifically is to use the 8 or 16 bit per channel luminescence gradation of an image as a mask upon another image. But I can't figure out how to copy anything into a linked mask, I can only figure out how to do regular painting in the mask. Whenever I try copying something it just pastes into a new layer, not into the linked mask. I thought maybe the solution was to copy into a new alpha channel, but I don't know how to use the alpha channel as a regular mask..

Is this making any sense? If not I'll try to reword it.

As a sidebar, is there an easy way that I can do multiple, 100% opacity, gradations using the gradient tool? Normally, when filling a layer with a gradient, doing the same thing again from a new angle erases the old gradient rather than adding to it. I can only add by either lowering the opacity (even when using 'transparency to colour) or using multiple layers...

gonzo
02-02-2003, 02:32 PM
Duh! Nevermind the last gradient question, I looked in the FAQ forum here and found the 'adding to gradient' answer there.. a little counterintuitive, but it works :)

DannyRaphael
02-02-2003, 02:39 PM
Gonzo:

Welcome to RetouchPRO. Congrats! You've just broken the all-time record for answering your own question! Well done.

By all means keep asking these good questions. Judging by the content of your first one, I'd say you are well qualfied to answer many, too. Don't hesitate to do that. We always appreciate it when those with knowledge and experience are willing to help out.
Again, welcome. If you haven't seen the RP site map yet, click the link below my signature. Picture sometimes worth 1K words.

~DannyR~

gonzo
02-02-2003, 02:43 PM
Thanks for the welcome. I only answered the gradient question myself though ;) I still haven't figured out how to copy pictures into masks.. can you help? It's such a simple, obvious thing, I used to do it *all the time* with my old gfx program, but can't find the magic button in photoshop..

jeaniesa
02-02-2003, 03:00 PM
Gonzo,

First, WELCOME to RetouchPRO! :)

If I understand your question correctly, I think that you want to do this:

1. If you're talking about a luminescence channel, I assume that is grayscale. So, make sure that the image you want to use for the mask is in grayscale mode.
2. Keep the grayscale image open along with the image you want to mask.
3. On the layer in the image that you want to mask, Load->Selection... Set the source document to your grayscale image and make sure that the channel is set to Gray. Click OK.
4. You should now see a selection based on your grayscale image. (Don't worry too much about the marching ant lines - the selection marching ants will only show areas that are above 50% gray and is not a good indication of what's actually selected when using a grayscale image for the selection.)
5. Click on the "Add layer mask" button at the bottom of your layers palette (second from the left). You should now have a linked mask that looks just like your grayscale image. (If you alt-click (PC) on the mask thumbnail, you'll see exactly what the mask looks like.)

Hope that I understood your question correctly and that my solution is at least close to what you're looking for.

Jeanie

DannyRaphael
02-02-2003, 03:03 PM
This may turn out to be a terminology thing, so bear with me. I'm not sure what you mean by a "linked mask."

Let's assume you're objective is to combine two Alpha channels, say, Alpha 1 and Alpha 2. These Alpha channels can be from whatever source... something you paint with black and white, a layer mask, a copy of one of the color channels -- whatever.

Duplicate Alpha 2 (drag the channel name over the "new channel" icon at the bottom of the channels palette), creating Alpha 3.

Then, SELECT > LOAD CHANNELS... (choose Alpha 1)
followed by SELECT > SAVE CHANNELS (from the dropdown that says 'New', click the arrow and choose Alpha 3)

Notice when you specify Alpha 3, the options Replace, Add, etc. become available. The resulting Alpha 3 will depending on the option selected.

Does this help? Keep asking if close, but no cigar. Now you've got two approaches to try. Not to fear. We'll get ya there - eventually.

~Danny~

jeaniesa
02-02-2003, 03:09 PM
Danny, You mean SELECT > LOAD SELECTION and SELECT > SAVE SELECTION (rather than LOAD/SAVE CHANNELS), don't you?

Jeanie

DannyRaphael
02-02-2003, 03:21 PM
Jeanie...

Thanks so much. Yes, load and save SELECTION... is what I meant.

Danny

gonzo
02-02-2003, 03:42 PM
Danny and Jeanie, thanks a bunch!

Jeanie:

Yay! This does what I need! It seemed a somewhat illogical and strange way of going about it, but hey, it works! . As soon as I figured out that I could have several images open at once and cycle between them in the 'load selection' box (which I have tried before, but not taken note of), everything else fell into place.

It is not necessary to convert the image used as a mask into greyscale btw. I just tested it, and you can just copy the image into the alpha channel first (which is always greyscale, hence the luminescence chatter), and then load the alpha channel as a selection into the other image. Yay!

Oh, and now that I actually got my brain running (a rare instance, I have to say) it's dead obvious that I can just do this within the same image.. so: copy relevant layer into alpha channel, then load selection->alpha channel, and make a mask. THAT was the magic button I was looking for! I *knew* it had to be something truly simple because it's needed all the time.. I also knew I was gonna feel really stupid when finding the answer, so thanks for bearing with me.

I better write this down before I forget it again.. I seem to forget most things I learn in photoshop, and of course I can never find all the post its with hints and tips on either ;)

Danny: I tried playing with the alpha channels like you instructed, and I hadn't tried subtracting and adding like that in alpha channels, so that was pretty cool.. not really what I was looking for, although I can't seem to wrap my mind around whether this could be used for the same purpose as well.. Sometimes I feel like I'm blind with all the options sitting staring me in the face and I can't figure out how to put them together.

Thank you both again for the help, very much appreciated.

jeaniesa
02-02-2003, 04:37 PM
Gonzo - glad I could help!! And yes, just copying the image to an alpha channel does make it a bit easier. I hadn't thought of that shortcut. Thanks! ;)

Jeanie

Stephen M
02-02-2003, 07:17 PM
There are more than one way to replace an existing layer mask alpha channel with other data.

* Target the layer mask alpha and not the layer content - select all and fill with white. Load your new selection and fill the targeted alpha with black.

* Target the mask, copy the pixel content previously saved as an alpha to the clipboard and paste into the target mask.

* Apply image can move data between the same file or multiple files, pretarget the mask and apply the new alpha.

Stephen Marsh.

gonzo
02-02-2003, 07:44 PM
* Target the layer mask alpha and not the layer content - select all and fill with white. Load your new selection and fill the targeted alpha with black.

- not sure what that accomplishes...?

* Target the mask, copy the pixel content previously saved as an alpha to the clipboard and paste into the target mask.

- my problem all along has been that I couldn't directly paste into the target mask. That's why I had to get around that by creating an alpha channel and then loading it as a selection. How do you go about flat out pasting into the target mask? Whenever I try to paste into a mask (with the mask active) a new layer is created instead with the pasted image on it.

* Apply image can move data between the same file or multiple files, pretarget the mask and apply the new alpha.

- that's something I haven't tried using before, it looks interesting.

Thanks!

Stephen M
02-02-2003, 08:11 PM
>> * Target the layer mask alpha and not the layer content - select all and fill with white. Load your new selection and fill the targeted alpha with black. <<

> - not sure what that accomplishes...? <


As I said, many roads lead to Rome in Photoshop...

This first suggestion targets the existing layer mask content and deletes it. Loading an selection then permits one to fill the current white targeted layer with content to make a mask.

I did not mention that you may have to invert the source before filling, otherwise the mask may be reversed. Try it, you just forced my to follow my own thoughts and it all works like I thought/said it would.


>> * Target the mask, copy the pixel content previously saved as an alpha to the clipboard and paste into the target mask. <<

> - my problem all along has been that I couldn't directly paste into the target mask. That's why I had to get around that by creating an alpha channel and then loading it as a selection. How do you go about flat out pasting into the target mask? Whenever I try to paste into a mask (with the mask active) a new layer is created instead with the pasted image on it. <

I thought the answer was obvious. <g>

Try turning on the eye or preview icon for the targeted channel before you paste. It does work.


>> * Apply image can move data between the same file or multiple files, pretarget the mask and apply the new alpha. <<

> - that's something I haven't tried using before, it looks interesting.

Thanks! <

Yes, I really like apply image - for many things.

Stephen Marsh.

gonzo
02-02-2003, 08:28 PM
Ok, the first one still completely leaves me blank. I'm just not getting what you're explaining.. sorry. I understand it's just a different way to do it, but I can't get it to make sense.

Second suggestion: Aha! So that's what I did wrong. I kept pasting into the layer mask itself, not into the alpha channel of the layer mask. Well, this is even simpler than the selection bit (and seems cleaner too). I come from a program that handles masks and alpha channels rather differently and obviously still haven't quite accustomed myself to photoshop. This helps me better understand how the channels work in photoshop.

I'll have to read up on the apply image function later..

Stephen M
02-02-2003, 11:00 PM
> Ok, the first one still completely leaves me blank. I'm just not getting what you're explaining.. sorry. I understand it's just a different way to do it, but I can't get it to make sense. <

Did you try it? Not that it matters, there are many ways to do this and that was the point in the method (it may not be the best way, but it is a way). Sometimes you actually have to do the steps instead of just going through them in your head (no matter now well you know Photoshop).

My post was brief and may presume some knowledge or steps, but the basics work in both my theory and my application of the theory, as you gave me doubts.

On apply image, an example is an existing layer mask and now you want to add a new bit that was created in another alpha. Simply pretarget the layer mask alpha and apply the new alpha to the old using LIGHTEN mode, so only the new white data is added and the black does not mess up the old data.

Stephen Marsh.

gonzo
02-03-2003, 06:46 PM
I completely agree with how it can be difficult to grasp what's going on without actually performing the steps.. in fact, most of the time I end up confusing myself endlessly if I don't *see* what's happening.

I think I'm just going to let that first suggestion go for now, but as far as I can tell the trick is similar there, loading selections and using the alpha channel of the mask.. Now that I know about both of those I feel I have a better idea how these things work. Until I forget it all again.

I come from different software and OS, so when I made the switch to photoshop it was hard to get the same kind of intimate feel.. there are also so many possibilities and ways of doing things that I tend to get sloppy and do it the 'dirty' way instead of figuring out the best functions (this whole layermask-has-an-alpha-channel is a good example). So many things in photoshop can be fixed by liberal use of layers and a bit of handywork when you don't know how to do it 'properly' ;)

Now that I'm at it, here's another thing that I can't figure out.. not so sure there is a solution though. I like working with selections to build up a shape, but it's not properly converted to vector (paths) when I use the 'make work path from selection' feature. That is, it will create a chunky path, instead of calculate a properly smooth one, which should be entirely possible to do. An example is to make a simple circle selection, then convert to path, then stroke and it'll be obvious - or convert back to selection again and stroke. It's not longer a smooth circle but has hard edges in some places. This feels kind of silly as something like this can be done with a simple formula, but I guess it's not able to interpret the shapes and instead does what seems like a rough copying - with a limited number of polygons kind of look. In effect, it renders the feature rather useless to me - but maybe I'm missing out on how to make it work properly?

Btw, the reason I like to convert into paths is a) I need to save the shape with the document and b) I like to make small adjustments later with the pen tools.

Stephen M
02-03-2003, 10:06 PM
Selections are really raster based, not vector. Photoshop is a raster application with limited vector abilities.

With a selection active enter quickmask mode and you will see what I mean, then toggle back out of quickmask mode (Q then Q). When in QM mode you can 'paint' selections or filter them (quick mask is a temp alpha - check the channel palette).

A simple aliased selection can make a nice path - but generally it is best not to make paths out of selections. If you must, try the select/smooth command first and or using a tolerance of 2 pixels in the path conversion.

In v6 or higher perfect symetrical paths by using shape tools which use the minimum # control points can be created and path operations can produce intersections/exclusions/overlaps etc and you can make larger more complex vector shapes by combining smaller primitives (like in making a 3d model on a computer).

As a selection is raster based, it is possible to make a path for a selection in a sub-pixel location, which the selection will then snap to.

At the end of the day, selections have the most flexibility when formed off a raster and not a vector element. For example you can make a black to white gradient and load this as a selection (it will not all be visible but it will work as intended) - this is not possible with a path. With raster based selections you can also combine hard and feathered edges in the one mask etc.

You are correct - the hardest thing about Photoshop is that there are many ways to do the same thing. There are no right and wrong ways to do things - it's just that some methods have advantages over others in different situations. Just remember, anything is possible in Photoshop - you just have to figure out how to do it. <g>

Stephen Marsh.

gonzo
02-04-2003, 12:46 AM
I do understand the difference between raster and vector, maybe I wasn't articulating it properly though..

The point I'm trying to make (well, whine about, really) is that it should be entirely possible for photoshop to analyze the selection (raster) because it's a perfectly clean line (and especially when using basic geometric figures which have few points and simple formulas).

Adobe has an old program that converts to vector (Adobe Streamline), and it would probably do a much better job than Photoshop given the same parameters.. just a guess though as I haven't done any testing.

I realize it's a big complex function to put into a non-vector package like photoshop, but since they already *did* put it in, I think they could do a much better job at it.. I figure that a program of this caliber either has a function very well implemented, or doesn't have it. I thought maybe I needed to adjust something when doing these selection to path conversions.

I fully realize the limitations of Photoshop's other vector tools (basically just a few pen functions), but they work well at doing the simple things they do.

I don't have Illustrator, did they move the vector tracing functions from Streamline into that since they discontinued Streamline a while ago..?

Btw, I use Quick Mask almost exclusively for any complex masking purposes. It just seems much simpler than fiddling with lasso or pen.. Although I knew what it was, I never actually thought to look in the channels to see the mask there, that was a neat bit of info. I used to do my 'quick masking' in other software by manually creating an alpha channel that was overlayed so I could see what I was painting in, then changing parametres later. Same concept, just a bit slower..

Thanks for taking the time on this, I'll be sure to bug in here next time I run into photoshop issues :)

Stephen M
02-04-2003, 06:47 AM
As you have seen - my point has been with both layer masks and quick mask that the underlying technology is actually in the channels palette which may not be obvious to someone new to Photoshop. Knowing this you can do things that may not be initially obvious if you did not know this (as earlier demonstrated).

My previous post on selections and raster/vector was with the same intent.

At the end of the day, it is not what the app should do but what it currently does. <g> What Photoshop should do for the feature request section at Adobe. There are a long list of existing features to be fixed and new ones to introduce and refine. It can be hard to understand why Adobe choose one feature over another (marketing and politics often decides things over user needs).

I do not expect a perfect path creation out of a selection, while you do. Perhaps what I think I know about the program taints my viewpoint, as does my long use of the app and the need for very accurate clip paths which are often only produced by hand with any satisfaction. I have been manually creating bezier curves since Illustrator 3 and Photoshop 2 for ever ten years - so my expectations are not as great as yours since I have a lot of baggage from version to version.

A long term user will accept more from an app than a new user.

As previously mentioned, having an aliased or antialiased raster of simple or more complexity will lead to different path quality if you do choose to convert to vector. In my experience it is rare that a selection makes a great path conversion, but it can happen.

It all depends. <g>

So I would construct more complex vectors by using path tool shapes and pen paths with path operations to form the combined shapes or do them by hand.

A simple selection can create a great path, but for more 'complex' selections the final result may not be ideal.

I have a small article at my site on PostScript clipping paths - which does contain a section with links to a third party product for making better path conversions out of selections:

http://members.ozemail.com.au/~binaryfx/PPT_clip.html

As for Streamline, it was never that great (I used the first and later versions, but they were only good in limited cases) - and I know that FreeHand had a 'good' autotrace tool, but not as good as Streamline (if I recall correctly? Illustrator has/had an autotrace too - which was not as good as FreeHands).

I guess I will have to depart the thread here - as we have very different ideas of what the app should do.

Stephen Marsh.

GOLDCOIN
02-04-2003, 09:10 AM
Stephen M...

Has anyone mentioned to you lately ..How appreciative so many of us are .........of your time and detailed information, you have so generously share with this Forum.

I have learned a great deal because of your efforts. At times, it was too far advanced, but as my knowledge of Photoshop has grown, it has really made a difference.

Glad you are "Here!".........

gonzo
02-04-2003, 10:05 AM
Stephen,

You make a good point on expectations. As I mentioned, I come from different software systems, so I'm used to taking that to the limit, knowing the in and outs.

With Photoshop I quickly got the impression that I didn't have to work around the limitations of the program, simply because there weren't as many. Don't get me wrong, this *is* my favourite program now. I guess I've just gotten used to that every function in photoshop works brilliantly within its own context. So when I couldn't get good tracing results out of the included trace (sort of) function, I thought perhaps I wasn't using it correctly.

As for Streamline, I've been using it to trace pencil and ink outline drawings and with some fiddling I've found it can do a very nice job. Just need to clean the drawing up in photoshop first.

Don't worry, I too have my own wishlist, but it wasn't my intention to make the thread about this :)

Thanks for your time and patience on this.