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

I need to centre & resize a layer to fill a 1000x1000 pixel canvas... Then automate

Community Beginner ,
Jan 08, 2024 Jan 08, 2024

Copy link to clipboard

Copied

Hi Everyone! 

I need help please. I have a large number of images (.PNG) that consist of a single layer (product image). 

I need to centre & resize this layer to fill a 1000x1000 pixel canvas. Then save the image on a white background as a .JPG

 

I need to automate this in the form of a batch as I have thousands of images that this needs to be done to. I have tried multiple things including recording my own batch actions but it doesn't seem to work. 

I have attached a screenshot below of what I want to acheive: 

What I have now (attachment 1 - capture.jpg)
What I want to create (attachment 2 - capture1.jpg)

Thanks again for your help in advance! 
Dom

TOPICS
Actions and scripting , Windows

Views

771
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 ,
Jan 08, 2024 Jan 08, 2024

Copy link to clipboard

Copied

These steps should do it, and can be recorded into an action:

 

1. Trim out the existing black border. Choose Image > Canvas Size, enable the Relative option, and enter -40 px for both Width and Height. (You don’t have to do this if the border is a Stroke applied as a Layer Style, only if the border is on the same layer as the product image.)

 

2. Remove empty surround: Choose Image > Trim,  select Transparent Pixels. 

 

3. Resize if necessary: Choose File > Automate > Fit Image. For Constrain Within, enter 1000 x 1000 px. (If you want a little padding around each product image, reduce those dimensions slightly.)

 

4. Set to 1000 px square, in case the original is not square: Choose Image > Canvas Size, deselect Relative option, enter 1000 px for both Width and Height. Now the product image should be within a 1000 px square, regardless of its shape.

 

5. Add back the black border: Choose Layer > Layer Style > Stroke. Set the Size and Color you want, and for Position choose Inside. 

Votes

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 ,
Jan 10, 2024 Jan 10, 2024

Copy link to clipboard

Copied

Hi,

 

Thank you so much for your help! It worked perfectly! The thing that kept catching me out was the "2. Remove empty surround: Choose Image > Trim,  select Transparent Pixels. " This little tool let me unlock the next step so thanks again! 

Votes

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 ,
Jan 08, 2024 Jan 08, 2024

Copy link to clipboard

Copied

A few questions :

What are the original images sizes? If you crop and change the pixels dimensions you may loose quality…

Are all images on a transparent background or other colors?

Do you need black border?

If  image sizes are sufficently large to be reduced to 1000 px and with transparent border a simple action will do the trick. You will be able to batch all with it. I could capture it to show you how to do it.

If not it's gonna be a little more complicated

Votes

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 ,
Jan 10, 2024 Jan 10, 2024

Copy link to clipboard

Copied

@defaultjhmfowdeilb6 

 

Where are you at with this project?

Votes

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 ,
Jan 10, 2024 Jan 10, 2024

Copy link to clipboard

Copied

LATEST

All finished now and it's working perfectly, thanks for asking! 

Votes

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
LEGEND ,
Jan 10, 2024 Jan 10, 2024

Copy link to clipboard

Copied

I do something similar with product photos and I use a mix of actions and scripts. This should be easy. Trim, select all and align to center, then flatten, then resize.

Votes

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