• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

Quick replace multiple layers with a chosen image

Community Beginner ,
Jun 07, 2023 Jun 07, 2023

Copy link to clipboard

Copied

Hi all,

A relatively simple question but I'm struggling to find a sensible way to do it. Any help would be much appreciated.

 

I have lots of images, hundreds in fact, similar to the attached. I would like to swap the circles, each of which is an individual layer, with another image (a square).

Crazy utopia: some magical way to batch process this based on layer name

Real world hope: Is there a way to select a load of layers (e.g. all the circles) and then tell Photoshop to replace all of those layers with a particular image, presumably duplicated across the layers?

 

So that an image goes from this 

nathanf55210958_0-1686202385152.png

 

To this

nathanf55210958_1-1686202850654.png


Ideas and mystical voodoo spells welcome!

 

TOPICS
Windows

Views

4.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Jun 07, 2023 Jun 07, 2023

Copy link to clipboard

Copied

Are you using smart objects?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 07, 2023 Jun 07, 2023

Copy link to clipboard

Copied

Hi Stephen, 

 

Thank you for replying.  I'm not,  they are just regular layers,  but I'm not adverse to converting them if it helps

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 08, 2023 Jun 08, 2023

Copy link to clipboard

Copied

If you need to switch in content at volume you should not convert to Smart Objects mid-journey – you should start with Smart Objects. 

And considering the images you might have chosen the »wrong« application altogether – looks like illustrator might have been a better choice. 

 

But it might be possible to automate the task to some degree. 

Please provide several layered sample images, at least one of them in both states (as-is and as-should-be). 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 08, 2023 Jun 08, 2023

Copy link to clipboard

Copied

Thank you. I inherited the images so unfortunately have to work with what I have. 

 

Really appreciate this. I'll upload a couple of examples today.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 09, 2023 Jun 09, 2023

Copy link to clipboard

Copied

I have just uploaded the file to another reply, in case you don't see this - here it is again:

 

In this example, figure A has been manually changed to the result I am looking for, and the old ellipse layers are simply switched off.  I have about 300 files like this, and I'm hoping to turn every small ellipse into a small square. 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2023 Jun 09, 2023

Copy link to clipboard

Copied

So the affected Layers are Shape Layers – great 

But they have been rotated (possibly even flipped) – c…p 

 

Comparing the Vector Masks would have been fairly simple if it weren’t for the rotation. 

Determining the rotation and counter-calculating it is obviously possible but, quite frankly, a bother and I am not completely sure about the flipping. 

An alternative, if considerably slower, approach would be aligning all remotely matching Shape Layers (based of number of PathPoints for example) and checking the transparencies against each other (Quick Mask, Histogram, …). 

 

Once one has determined which Shape Layers match one could convert each of that group to a Smart Object, relink them all to the same external file and then embed that. 

 

@nathanf55210958 , how good are you with JavaScript and how much time are you willing to invest in this task? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 08, 2023 Jun 08, 2023

Copy link to clipboard

Copied

Are they all the same size? Are the circles all in the exact same position?

If yes, and I have not tested so can't say for sure this would work, but:...

 

  • Make a new document with the squares in the apropriate location and with transparent background.
  • Make the layer a Smart Object, and save it in a Creative Cloud Library.  You can simply drag it to the Library panel to do this.
  • Make an Action that places the Library layer at the top of the layer stack, and flattens the image.
  • Place all of the images into a folder, and use Image Processor to run through the folder, running the Action.

image.png

image.png

You'd want to save the edited images to a new location I'm thinking — just in case.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 09, 2023 Jun 09, 2023

Copy link to clipboard

Copied

Thank you Trevor. Unfortunately there are hundres of images, each one with circles in rnadom places, that all need replacing with squares (or turning into squares, the are ellipses, if there is an action to turn every ellipse into a square, that would achieve the same thing.)

 

I'm uploading a PSD file here as requested previously. In this example, figure A has been manually changed to the result I am looking for, and the old ellipse layers are simply switched off.  I have about 300 files like this, and I'm hoping to turn every small ellipse into a small square. 

 

I've read about the creative AI being released in PS, I don't suppose that could help?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 09, 2023 Jun 09, 2023

Copy link to clipboard

Copied

@nathanf55210958 

 

Please upload say 3 random examples of the original files and the replacement element/s.

 

Mockups don't help, the real, actual files are what is required to examine to develop a possible solution.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 10, 2023 Jun 10, 2023

Copy link to clipboard

Copied

It is possible to change the Shape Layers of (practically) identical Vector Masks to the selected Shape Layer, even if rotated and flipped, to instances of one Smart Object via Script. 

Once that is done one can easily change all the instances in one go (see screenshot 3). 

But transfering the rotation and flipping to those SO-instances would seem like a bother, so it only would make sense for, in this case, the circles and squares. 

Screenshot 2023-06-10 at 21.32.06.pngScreenshot 2023-06-10 at 21.33.00.png

Screenshot 2023-06-10 at 21.37.41.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 14, 2023 Jun 14, 2023

Copy link to clipboard

Copied

@nathanf55210958 , is the issue still relevant? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 17, 2023 Jun 17, 2023

Copy link to clipboard

Copied

I think I got a handle on rotations and flipping of the replaced Shape Layers, but as the bounds of a rotated shape (other than a square or a circle) are difficult to assess the rotation and repositioning are two steps and the script is accordingly far from fast. 

comparePathsTesScr.gif

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 18, 2023 Jun 18, 2023

Copy link to clipboard

Copied

quote

7. In the document with the square image, arrange the duplicated layers in the desired positions and order.

8. Once you're satisfied with the arrangement, select all the duplicated layers in the document with the square image.

I think that is what the original poster wants to avoid – manually recreating the arrangement. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 29, 2023 Oct 29, 2023

Copy link to clipboard

Copied

LATEST

To swap multiple layers in Photoshop, you can use the following method. While it may not be fully automated, it is more realistic in the real world:

1. **Organize Your Layers**: Make sure all your circle layers are properly named and grouped if necessary. It will make the process more manageable.

2. **Prepare Your Square Image**: Open the square image you want to replace the circles with in Photoshop. Make sure it's the correct size and resolution.

3. **Place Square Image on Top**: Drag and drop your square image onto your document with the circles. This will create a new layer with the square.

4. **Position the Square**: Use the Move Tool (V) to position the square image over one of the circles. Make sure it's properly aligned and scaled to fit the circle.

5. **Clip the Square**: Right-click on the square layer and choose "Create Clipping Mask." This will mask the square to the shape of the circle beneath it. Repeat this process for each circle.

6. **Repeat for All Circles**: You'll need to manually repeat the above steps for each circle layer. If you have many layers, this can be a bit time-consuming.

7. **Delete Circle Layers**: Once you've replaced all the circles, you can select and delete the original circle layers.

This method should achieve the desired result but may require some manual work, especially if you have a large number of layers to replace. Photoshop doesn't have a built-in automated way to batch replace layers based on layer names directly.

Keep in mind that for a more automated solution, you might need to explore scripting in Photoshop, which can be quite advanced and may require programming skills. Photoshop's batch processing capabilities are generally more geared toward actions that affect the entire image rather than layer-specific changes.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines