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

Need a script to resize a layer proportionally for various layer dimensions.

New Here ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

I have an action that creates a drop shadow effect on image files that are 3:2 aspect ratio, but it does not work on aspect ratios that aren't that ratio, which happens a lot, so I have to do the effect manually.  Takes time and is inconsistent.  I wonder if anyone has a script that would work.  All my images are 2048 px on the longest side at 100 ppi.  The short side is variable.    I want to resize the layer so that the border around the layer that is transformed and is smaller than the white layer below it.  See the attached image.  If I could incorporte a script that does this into my action, I'd be able to save a lot of keystrokes!  Can anybody help with this?

 

Thanks

 

 

TOPICS
Actions and scripting

Views

1.4K

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
Adobe Employee ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

Hi Suzanne,

Could you please have a look at a similar discussion here and let us know if it helps?
https://community.adobe.com/t5/Photoshop/Resizing-Script-or-conditional-action/td-p/9816427

 

Regards,
Sahil

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 ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

Can you post an example of when this doesn't work correctly? What is off? You can use scriptListener to record the applying of the drop shadow, then insert variables for the amounts to vary the effect, depending upon your image size.

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 ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

How do you attach a photo in your reply? No tools to do that.

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 ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

The result of the script should be a 55px wide white border in an image that always 2048 px on one side and variable but not to exceed 2048 px on the other side. Resolution is 100 ppi. The border is exposed when the top layer is resized to expose a 55px wide area on all sides of the layer below.

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 ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

If you have Programming skills script programming is not very hard.  I would suggest using JavaScript for Photoshop  script may then  work on both PC and Mac platforms.  If you center the resized images that do not have a 3:2 aspect Ratios over the 3:2 image ares there will be boarders on two side.  A script could also eesize  the image to fill the 3:2 Aspect Ratio image area and have the extra layer content masked off.  The image composition would be like a centered Aspect Ratio Crop. Howeve, Portrait  aspect ratio images into a 3:2 landscape image aspect ratio will have to mush image content masked off and not have an acceptable image content

JJMack

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 ,
Sep 23, 2019 Sep 23, 2019

Copy link to clipboard

Copied

If you look closely at the DSC-6361 image above you will see that there is a stroke added to the very outside of the image, which will cause problems is you use a mask to form the correct boarder, which is 55 px around all sides with a 5 px black stroke on the inside edge. Please look at DSC_8394 above to see the application of the same action to a non 3:2 aspect ratio image. The action isn't adjusting for the change in the aspect ratio. I don't have any programing skills. I would be able to incorporate a script into an action in PS but not capable of writing a script.

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 ,
Sep 24, 2019 Sep 24, 2019

Copy link to clipboard

Copied

You could use a different method to create the drop shadow, that is not dependent on aspect ratio...

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 ,
Sep 24, 2019 Sep 24, 2019

Copy link to clipboard

Copied

The biggest problem is resizing (transforming) the top layer to get the 55 px border which is revealed when the transformed layer is laid over the white layer below. I can add a drop shadow in the action to the correct layer once the transformation occurs without any problem. The script would resize proportionally to get the right sized border and then the drop shadow would be added at the end, along with the stroke.

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 ,
Sep 24, 2019 Sep 24, 2019

Copy link to clipboard

Copied

LATEST
My answer is the same then, use a different method to create the frame. Can you post a link to the final .psd layered template?

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