What's new

Actions Cropping problem


ColMac

Member
Messages
6
Likes
1
I am currently working on thousands of old family history shots. After scanning, (usually 2 photos at a time). I am using a crop and straighten script to process a folder full of images (I get the same result if I process individually using "Crop & Straighten")

The results are pretty good, but most images have a tiny white border around some or all edges (not always totally straight white edge either).

Google search results seem to indicate that this is a fairly widespread problem, but I haven't found a solution.

My thoughts were that using a content-aware crop to solve the problem might be one option. I tried a few manually, and it does seem to work. However, as I have thousands of images, I need to automate this, and its beyond my skills.

What I'd like is to add say 1 pixel to all edges, then content-aware crop to fill the white line that was left by the original crop and straighten, PLUS the 1 pixel I've added. This would hopefully correct the images where the original white line was not consistently level.

Any help (or alternative suggestions) would be welcome.

Thanks

Colin
 

IamSam

Administrator
Staff member
Administrator
Messages
18,249
Likes
11,548
Thanks for understanding the view counter problem. Unfortunately, while I have a limited knowledge of Ps actions, Ps automation with scripting is not in my wheelhouse. We do have several members who are experts in this area, and hopefully, now that the holidays are passing, they will show up and offer you some help and advice.
 

thebestcpu

Guru
Messages
1,465
Likes
1,271
Hi Colin
I believe I have an approach worth considering that does not require a script.

Note that doing a content aware fill to come out good requires the selection to overlap the good pixels (so an odd bourndary line is not created.
Also, trying to differentiate between the white boundary and some elements of the image that may also be white along the edge makes the selection process potentially problematic/complex.

So here is a simplified approach that may work if you don't have critical elements within about 10 pixels of the image boundary.

1) Use Cmd + A (Cntl + A for windows) to select the entire windo
2) Modify this selection by contracting it ~ 10 pixels. The acutal contraction to use is based on the worst white edge created by the crop and straighten script
3) Invert the selection so you ahve a boundary around the entire image that includes the white edge and some overlap into the image
4) Use content aware fill

The above approach may be a bit of overkill as you are doing content aware fill where you may not have an issue yet in all atemps that I have made, it came out just fine. This approach is easy to implent and may just do the job for the vast majority of your images.

Hope this is worth considering for you

John Wheeler
 

ColMac

Member
Messages
6
Likes
1
Hi John

That works pretty nearly perfectly for me. Huge thanks.

In fact, the first image I tried it on did not produce a good result - as you said
.... if you don't have critical elements ....
I did not think that that image had any particularly critical elements, so I had hoped it would be ok, but Photoshop (with its far greater intelligence than mine) obviously though differently! But I tried it on others and it worked just fine.

Next, I've done a bit of experimenting with your concept, and so far, I've managed to reduce the initial selection down to 5 pixels. This deals with the vast majority of my issues. I've then recorded it as a macro (with a keyboard shortcut as well) so I can bulk Or individually) process a directory at a time.

Then, I created a duplicate copy with a stop in the middle allowing me to edit those few cases where 5 px was not enough. (I can also exclude some critical elements at this stage as well).

The combination lets me automate the process but also lets me re-process and adjust where I find a problem.

Many thanks.

Colin
 

thebestcpu

Guru
Messages
1,465
Likes
1,271
Glad that worked for you Colin
Sometimes a simple approach with incremental refinements ends up being the faster path to being done.
John Wheeler
 

Top