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

Using the Gradient Tool in an Action

Contributor ,
Mar 19, 2025 Mar 19, 2025

I realize it’s probably a stupid question that has a simple answer, but I can’t figure out how to do it .

 

I’m trying to create an action that selects the gradient tool and draws a fixed gradiant on all four edges of the canvas.

 

The action that I have created is able to draw the top and the left gradient just fine, however I can’t figure out how to do the right and bottom edge that will work with different sized images?

 

The other issue that I am having is that after the gradients are drawn, the selected tool goes back to whatever tool I had been using and doesn’t stick with the gradient tool, which is what I want it ti do after hanging the opacity from 100% to 30%.

 

Any help on this would be greatly appreciated. Thanks in advance - CES.

TOPICS
Actions and scripting , macOS
134
Translate
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 ,
Mar 19, 2025 Mar 19, 2025

Could you please post screenshots taken at with the pertinent Panels (Toolbar, Layers, Properties, Options Bar, …) visible? 

Why don’t you use Gradient Layers? 

Translate
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
Contributor ,
Mar 19, 2025 Mar 19, 2025

The Rectangular Markee Tool was active prior to the start of the action after the action is run it returns to the previous tool. the first action is identical to the one that is open only the gradient is drown from the top. The reset workspaces just closes all open panels.

 

Screenshot 2025-03-19 at 1.22.02 PM.png

Translate
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 ,
Mar 19, 2025 Mar 19, 2025

Hi evan.sante,

For your first issue with the right and bottom gradients, here’s how you can ensure the gradients work on different-sized images:

  1. Use the "Make Work Path" technique: Create a work path around the edges of your canvas. Then, you can apply the gradient to the path, ensuring the gradient is drawn around all four edges. This will work for any canvas size.

  2. Set Fixed Gradient Positions: In the action, ensure you're using "Fixed" gradient stops (not relative positions) so that the gradient will stretch across the edges without changing size based on the image.

For the second issue, where the tool doesn’t stay on the Gradient Tool, you can:

  • After applying the gradient, manually switch to the Gradient Tool in the action, and then set the opacity to 30% before finishing the action. This will ensure the tool stays on the Gradient Tool with the desired opacity.
Translate
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 ,
Mar 19, 2025 Mar 19, 2025
LATEST

I first tried to do it with Gradient Fill layers, but it was difficult to control such a narrow gradient across a large image. I also tried the Diamond and Radial Gradient Fill layer types because they cover all four corners at once, but they had other issues that made it difficult to match the posted example.

 

What might work is the approach I took that’s shown in the demo below:

1. Draw a rectangle shape layer (vector, not pixel) that covers the gradient distance and is also longer than the longest dimension of the largest image you need it to adapt to. I draw the rectangle shapes as vector shape layers (with the Rectangle tool, not the Rectagular Marquee tool) so that they are resolution-independent and easy to resize later if needed. 

2. To that rectangle shape layer, apply the gradient fill you want. 

3. Make three duplicates of the layer, and rotate each for the other three edges and move them into place along each edge. You’ll probably need to rotate their gradient angles too. 

4. Group the four edge gradient shape layers. 

This layer group needs to be added to each document. You could make an action that draws them, or you can leave the layer group in the Libraries panel so that you can drag it into any document that needs it.

 

OK, now here is the part about adapting the border to different document sizes. Suppose you add the layer group to a document and it doesn’t fit the document size. Record the following steps in an action:

1. In the Move tool options bar or in the Align panel of the Properties panel, set alignment to Canvas. 

2. For each gradient-filled shape layer, use the Align buttons or the commands on the Layer > Align submenu to align that layer to its edge. 

 

In the demo below you see that I recorded the alignment action steps in advance, and at the end I reveal the Actions panel. I change the document size from a square to a rectangle, then run the action, and it aligns each gradient-filled rectangle to its side. 

 

Photoshop gradient four corners.gif

Translate
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