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

Photoshop Script to replace white borders with Content Aware Fill option

Participant ,
Apr 21, 2023 Apr 21, 2023

Copy link to clipboard

Copied

Hi, 

Have a lot of images to process, is there a way to select white vertical or horizontal strip from image so I could made a script ( or action ) to replace white aeras with Content Aware Fill option... 

Thanks in advance, 

Christian

after with Fill Content Aware optionafter with Fill Content Aware optionbeforebeforesame need but with vertical white aerassame need but with vertical white aeras

TOPICS
Actions and scripting

Views

841

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 ,
Apr 21, 2023 Apr 21, 2023

Copy link to clipboard

Copied

An action could probably do this if the images were pre-sorted.

 

Are the white areas pure white? If these are say JPEG files, chances are they are not pure white due to compression artefacts.

 

Are the images mixed together, or can you pre-sort them into two folders depending on whether the white is at the head/foot or the sides?

 

Are you looking to create layered PSD files, or copies in say JPEG or other formats?

 

Can you provide links to the actual files (two of each kind) and not screenshots?

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
Participant ,
Apr 21, 2023 Apr 21, 2023

Copy link to clipboard

Copied

Hi Stephen, 

First, thanks for your answer ! 

Here is the file and answers from your questions : 

- Yes, it pure white ( because it was resized images and ratio is not homothetic to fit in pre-define format - for web purpose)), and images are Jpeg so effectively it could have artefacts...

- Images are pre-sort : landscape folder, portrait folder effectively, depending head/foot and sides

- I'm looking to copies in Jpeg format

 

Thanks for your help  Stephen : my firt attempt is the abaility to select white for sides or head/foot, after that effectively I can do Action or Script. Testfile02.jpgTestFile01.jpg

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 ,
Apr 21, 2023 Apr 21, 2023

Copy link to clipboard

Copied

It looks like the images were originally without the white extension, then the canvas size was changed to a set size which added the white extension. If the images were all consistently sized, then it would be easy to adjust the canvas size to crop away the white, then you could extend the canvas using transparency from a "floating" layer (not Background). Then content aware fill.

 

If you need to work with the white backgrounds, then you can use the magic wand tool with an appropriate tolerance value and ruler units set to either % or pixel and sample say the upper left, then hold down shift to add to the selection and sample the lower right (or whatever position you like that is appropriate). Then expand the selection a few of pixels to overlap the image content and then content aware fill.

 

One action could do both types of images. Of course edge content such as the phone on the bedside table will be a challenge.

 

Here is a screenshot of the action that I played with:

 

action.png

 

Your choice on whether to save layered files or not, many images would likely require extra work to make the more presentable.

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
Participant ,
Apr 24, 2023 Apr 24, 2023

Copy link to clipboard

Copied

LATEST

Thanks for your answer Stephen, I'll investigate from your test. Thanks for your 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