What's new
Photoshop Gurus Forum

Welcome to Photoshop Gurus forum. Register a free account today to become a member! It's completely free. Once signed in, you'll enjoy an ad-free experience and be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Multiple windows (masks) onto a single layer?


IanC

Active Member
Messages
27
Likes
1
I have a large image, and want to use the new generator feature to automatically extract two specific areas of this image (which is on a single layer) to two separate files.

Simple enough to do the first, using a layer mask, and works beautifully. But I can't work out how to do another, without copying the main image layer. Any ideas?
 

hawkeye

Guru
Messages
2,378
Likes
1,113
I may not be understanding you correctly. But if you want to use a mask on multiple layers, put the layers into a folder and use a layer mask on the folder.
 

IanC

Active Member
Messages
27
Likes
1
Thanks. My fault - I did wonder if I'd explained properly!

It's sort of the other way round. I have ONE image layer. I want to create one layer (mask) which is a 'window' to a certain part of the image. And a totally seperate layer (mask) which is a 'window' to another part of the image. Each 'window' is totally independent of the other. In CAD (with which I'm far more familiar), we'd call these 'viewports'.

Hope that's clearer? I'm using the term 'window' as plain-english as I'm not 100% sure that a mask is what I need.
 

hawkeye

Guru
Messages
2,378
Likes
1,113
I guess I still don't understand. If you make the mask black then you use white to reveal any areas that you wish to show on a single layer. Maybe post a screen shot.
 

SCTRWD

Power User
Messages
457
Likes
239
Convert your image to Smart Object. Now for each viewport make a copy of this Smart object, add a mask to it, unlink the mask and move/transform(Ctrl-t) the copy to your liking.
 

IanC

Active Member
Messages
27
Likes
1
SCTRWD - so if I do this, does that mean the image only exists once? I.e. as a Smart Object, the copy is somehow linked-to/updated-by the original?

I'm trying to avoid having more than one main/original image. The main image will be updated in future, and when it is, I want to extract/generate the same precise region of the image.
 

Steve

Retired Administrator
Messages
7,868
Likes
1,506
Generator is a feature of Photoshop CC I can't help you but I did find this.
Hopefully it will help.

[video]http://tv.adobe.com/watch/creative-cloud-for-video/adobe-generator-technology/[/video]
 

IanC

Active Member
Messages
27
Likes
1
Convert your image to Smart Object. Now for each viewport make a copy of this Smart object, add a mask to it, unlink the mask and move/transform(Ctrl-t) the copy to your liking.

Thanks, already watched that one!
 

IanC

Active Member
Messages
27
Likes
1
OK here are some screenshots:

The original 'whole' image (layer masks disabled):
Original image unmasked.jpg

Mask applied to area AA:
AA active.jpg

And BB:
BB active.jpg

(Of course I could also apply the masks to AA and BB simultaneously).

This works, but I've had to create two instances of the underlying image. What I'm trying to do is have only one instance of the underlying image - is this possible? Or do I need a totally different approach?
 

SCTRWD

Power User
Messages
457
Likes
239
SCTRWD - so if I do this, does that mean the image only exists once? I.e. as a Smart Object, the copy is somehow linked-to/updated-by the original?

I'm trying to avoid having more than one main/original image. The main image will be updated in future, and when it is, I want to extract/generate the same precise region of the image.

Yes, the Smart Object source is one, to change it - right click on any copy and choose Edit Contens. Once you done with the changes, press Ctrl-s and all of this SO views will update accordingly.
 

Tom Mann

Guru
Messages
7,223
Likes
4,343
I may not understand what the OP wants, but see if this approach sounds reasonable:

Make your first selection / viewport. Hit select / "save selection" and, if you want, give it a name. Hit cntrl-D to remove that selection.

Repeat the previous line for each selection / viewport that you need.

If you look in the "channels" palette, you will see each of the selections that you have saved.

To use these selections, cntrl-click on one of them. This will make a selection. Copy that selection from the background layer to a new layer. Hit cntrl-D to remove that selection. Then do the same for each of the selections / viewports that you defined.

You will now have a document with a separate layer for each of your viewports. Each layer will have a transparent region (which you want to preserve).

Use any means you want to copy each of these layers to separate png files. For pre-CC users, "scripts / "export layers to files" would work. I presume that the new "generator" tool would also work, but I'm not a subscriber to the CC edition, so I can't check this.

I'm pretty sure that that the "export layers to files" script gives you the option to have it automatically trim away any transparent areas on a layer, but, if it doesn't, you can either write or find a little action to do this.

I think this gives the OP exactly what he wants, namely, it requires only one copy of the image, reusable, well-defined layer masks, pixel level accuracy in placement of the viewports when you modify the base layer, etc.

Thoughts?

Tom
 

IanC

Active Member
Messages
27
Likes
1
The only thing that's disappointing, is that it appears that for every copy I make, the filesize increases correspondingly, i.e. two layers are roughly twice the filesize of one. Is this inevitable, or am I doing something wrong? I had hoped for only a very small increase for each reference to the original object....

The original source is in fact a PDF, from which I'm trying to extract various parts as raster images. The PDF will be updated in due course by others, a number of times. So in an ideal world, I'd hope that the PSD would be very small in size, i.e. contain only a reference(s) to the PDF source, and PS would generate new raster files whenever I needed (i.e. I'd received an updated PDF, and open PS to automatically generate the new rasters).
 

SCTRWD

Power User
Messages
457
Likes
239
File size grows because PS has to store each copy's raster presentation with all transformations and filters applied.
If you concern so much about file size open Smart Object, turn off it's layers visibility, save. This way there will be no raster presentations in PSD file. When you have to work with the file, open it in PS and set the Smart Objects contents visibility back on. Simple action will help you automate this things.

Keep in mind that Smart Object ARE NOT references to external files and can not be used as such. To update the Smart Object with some external file you have to select any copy in Layers panel, right click and choose Replace Contents...

Again you can make a simple action for it.
 

IanC

Active Member
Messages
27
Likes
1
Keep in mind that Smart Object ARE NOT references to external files and can not be used as such. To update the Smart Object with some external file you have to select any copy in Layers panel, right click and choose Replace Contents...

Again you can make a simple action for it.

OK, thanks, point taken.

Actually I'm running up against another problem now! But I guess the Generator is new to us all, so I actually don't feel quite so dumb about this one :cry:. The generated files (jpg) get cropped to a bounding box, so if the viewport/mask originally contained some transparency along at least one edge, when the source file is updated, the output image dimensions can change if the bounding box changes size (but is within the mask still). So I think my only option is to group each layer with a background, then apply the mask and output filename to the group.... Unless there's a more elegant solution?
 
Last edited:

Top