Skip to main content
Known Participant
May 17, 2023
Question

automate impossible to achieve task. A challenge for photoshop actions/script Gurus

  • May 17, 2023
  • 3 replies
  • 3236 views

I have a large collection of inconsistent JPG images with high resolution that I need to resize, crop, and compress for web use. The main challenge is automating multiple actions. Here is what I would like to achieve:

1. Convert the images into smart objects.

2. Slice the images into parts, (required for horizontal images).

3. Remove watermark/numbers (if present in the image)

4. Blur background (to increase focus on the subject)

5. After that, detect the main subject and crop them with a 150px top and 100px bottom margin around the subject.

6. Next, resize the images to specific dimensions, such as 800px wide and 1000px tall, while maintaining a 4:5 aspect ratio.(if image dimensions are bigger than that)

7. Convert the images to the WebP format, aiming for a file size between 100-200kb.

8. Export the images while preserving the sub-folder structure of the original source folder.

Is it possible to automate this process, either fully or partially? Please guide me, I will highly appreciate your kind help

3 replies

c.pfaffenbichler
Community Expert
Community Expert
May 20, 2023

Please provide at least one original image and the resulting file/s you want to create to clarify your point. 

 

Do you understand what (the advantages of) Smart Objects are? 

 

»Hence I have decided to go with the 2nd option which is to blur the background, it solves all problems at once and it can be automated completely to my knowledge.«

How would this solve the problem of creating a decent selection of the subject of the image?

Are you referring to the »Depth Blur«-Neural Filter? 

 

raeenAuthor
Known Participant
May 21, 2023

So here is the original image I received from the owner without a watermark or number. Below are the steps I took to obtain the desired image (referred to as processed image 1 & 2):

  1. Automatically slice the vertical image into two parts and save each part as a PNG file.
  2. Open one of the slices and crop the image to conform to a 4:5 ratio. If there are white vertical bars on the left and right sides of the image, select them and fill them with the content-aware tool.
  3. After that, use the "Select Subject" tool to select the subject and then inverse the selection to select the background.
  4. Apply a Tilt-Blur effect to the background, directing it towards the bottom.
  5. Next, resize the image to be 800 pixels wide and 1000 pixels tall.
  6. Save a copy of the processed image in the webp format.

Currently, it is not possible to automate all of these steps together, especially step 2. Therefore, I suggest saving the sliced images as smart objects or PSD files to avoid losing quality. Then, perform each processing step one by one and finally export all the images in webp format.

 

I have attached original image and desired image(after processing) with the hope to get a reply 

Earth Oliver
Legend
May 21, 2023

Convert an image into a smart object doesn't magically avoid quality loss. Just take that step out of the process.

Ivan Zajats
Inspiring
May 18, 2023
quote3. Remove watermark/numbers (if present in the image)

 

By @raeen


sounds like smth illegal...hm

raeenAuthor
Known Participant
May 18, 2023

Don't worry, I have permission

Stephen Marsh
Community Expert
Community Expert
May 18, 2023

This would likely be a major roadblock to automation, but without seeing samples it is hard to know. Much better to get versions without numbers or watermarks if you have permission to remove them.

Stephen Marsh
Community Expert
Community Expert
May 18, 2023
quote

Is it possible to automate this process, either fully or partially? Please guide me, I will highly appreciate your kind help


By @raeen

 

This is hard to answer without a broad sample of images and more specific info on the requirements.

 

#1 - Creating a SO should be no problem, but should this happen as the first step or after you "slice"?

 

#2 - Examples would help, I'm not sure if you mean slice as in slicing for save for web or simply cropping?

 

#3 - Samples are needed, however, this may be a barrier for automation. Why can't you get clean originals, why are there numbers/watermarks and is it ethical to remove them?

 

Etc.

 

Tackle each step one at a time, then see if you can make a combined, cohesive workflow from each separate step.

raeenAuthor
Known Participant
May 18, 2023

Think there is a source folder and it has 200 sub-folder.
Each sub-folder has product pictures of one product/style.
Some sub-folder have only portrait images, some have only horizontal images and some have mix of both.
Most horizontal images are composite of two portrait images. When we select the slice tool, the tool automatically snaps into 2 parts(when we divide slice vertically in 2 parts)
I want all images in portrait form to use on the website
To my understanding, it would be better to first convert all images into smart object
Then slice/split horizontal images into 2 parts and save each individually.
Up to this point, all images would be in portrait hence cropping/resizing images in batch would be possible.

 

There is no issue of copyright to remove name/numbers as we have permission from the owner

Stephen Marsh
Community Expert
Community Expert
May 18, 2023

That explanation helps a bit.

 

I doubt that the slice tool is going to help with automation. Easier to just adjust canvas size to 50% width for left and right sides.

 

A script can differentiate between landscape and portrait and process accordingly, but how to auto process landscape if they are not all actually a 2up combined image??? Filename? Metadata?