Skip to main content
Participant
June 28, 2018
Question

Issue with Batch processing and Actions

  • June 28, 2018
  • 2 replies
  • 1508 views

So I have a bunch of PSD files that I'm trying to resize and expand the background. The backgrounds are solid colors. The issue that I'm having is that the background layers are not named the same or the files don't have the same amount of layer.

When I go to expand the canvas size I want it to match the same color as the background. Here are my current actions list.

1. Image Size (reduced)

2. Merge Visible Layers

3. Canvas Size (Larger)

Here is where I get stuck. I want to fill the transparent canvas with the same color as the background but if I use the eye dropper tool it will do that one color. For example if one picture has a black background and I use that one to create my actions. When batch processing it will use the black color on the other files even if they have a blue background.

I need way to select the current color of the file that it's processing to fill the expanded canvas.

Any help would be greatly appreciated.

Thanks

This topic has been closed for replies.

2 replies

Bojan Živković11378569
Community Expert
Community Expert
June 29, 2018

This may be possible only if there is constant in your files like the top left pixels have a color which you want to use to expand canvas. If that's true then try to record step with Allow Tool Recording (check this option from Actions panel menu) to sample color from top left of your file. That will set that particular color as Foreground color. In the action you should have step: Use eyedropper. This step expanded wil show you Recording Data (data)....

What you need in your action (as I have quickly develop it) will be following steps:

  1. Ensure that image is flattened
  2. Use Eyedropper to set color from top left of the image
  3. Convert Background layer to normal so you can expand canvas with transparent pixels and to add layer below
  4. Use Canvas Size to expand canvas with transparent areas
  5. Create new blank layer below
  6. Fill with Foreground color (which will be set using eyedropper in the second step)
  7. Flatten image

Here is action which I have recorded. You can re-record Use eyedropper and Canvas Size steps (Canvas Size will expand canvas to 130% in my action) Eyedropper.atn - Google Drive

So test action and tell me how it works.

JJMack
Community Expert
Community Expert
June 29, 2018

The major Issue I have is I would need to script  the process to set the color for each image.  The Eye dropper tool in actions just set the color it does not record the sampling of a point.  So I would need to sets a color sampler and get its color in a script.  Tool recording does not work for me I install Adobe's scriptlistener plug-in which disables tool recording in actions.

JJMack
Bojan Živković11378569
Community Expert
Community Expert
June 29, 2018

For me, it works just fine it always sets color from the top left corner.

Here is the image with action which I have provided above played twice. First time it expanded canvas with color from the image. I have added custom color (black) in the top left corner and played action again. Here is the result.

Here is landscape photo with custom color in the top left corner.

JJMack
Community Expert
Community Expert
June 29, 2018

It sounds like your PSD do not have a background layer. If you did when you expand the canvas size the background layer expanded canvas would be filled with the background color for it does not support transparency. If you expand a document canvas that does not have a background layer no pixels will be added the expanded canvas area will be transparent. No Layers pixels are changed layer sizes do not change. Your Action would need to use the eye dropper tool to set the  background or foreground color swatch.  Expand the canvas to the size you want. Add a new empty layer on top and fill that layer with the background color. Move the layer to the bottom of the stack and covert it to a background layer if you want.

JJMack