Photoshop: Automatic Crop after Panorama / Photomerge ?

  • 3
  • Question
  • Updated 7 years ago
  • (Edited)
Dear all

Aside from manually using the crop or trim tool, is there an automatic way to crop the largest permissible *internal* rectangular area from a freshly photomerged image??

I stitch panoramas very often and would like a way for Photoshop to automatically trim the image so it can be flattened and saved immediately.

Am attaching a picture to help describe what I'm after and would appreciate any thoughts you may have!

Regards
Photo of Wideangle 1234

Wideangle 1234

  • 4 Posts
  • 0 Reply Likes
  • seeking a feature...

Posted 8 years ago

  • 3
Photo of Wideangle 1234

Wideangle 1234

  • 4 Posts
  • 0 Reply Likes
Apologies, attaching image....
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 843 Reply Likes
You could get different (and larger) crops by rotating the crop area in your example. Finding the optimal crop may not be something that can be automated.
Photo of Wideangle 1234

Wideangle 1234

  • 4 Posts
  • 0 Reply Likes
Thanks, Chris, appreciate the consideration.
Photo of David Dobish

David Dobish, Senior QE Photoshop

  • 200 Posts
  • 51 Reply Likes
While not a crop, I have had good results doing a Content Aware Fill after a photomerge. This works especially well on sky and grass. I have some code that I could post up here to create a JS file to do this automagically if that is something you are interested in.
Photo of Wideangle 1234

Wideangle 1234

  • 4 Posts
  • 0 Reply Likes
David, that would be very useful given the hundreds of images I have to go through! Any help would be appreciated.
Photo of David Dobish

David Dobish, Senior QE Photoshop

  • 200 Posts
  • 51 Reply Likes
I posted some code that did not work so I removed it. I will work on it some more.
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15504 Posts
  • 2306 Reply Likes
Official Response
I posted Dave's script here:

http://tranberry.com/Photomerge_wo_di...

Right-Click the link to download the script.

The script will pop a dialog asking for some images to create a panorama with Photomerge. It then flattens the resulting layers and does a content aware fill to fill in the missing areas around the panorama.

I added some code so you can undo the layer merge and content aware fill in one step.
Photo of Juerg Schmidlin

Juerg Schmidlin

  • 2 Posts
  • 0 Reply Likes
I know I am late....
just tried the scrip but it did not work...ask me to select file(s) but the only file extention available is one called NULL (null). Any suggestions?
Thanks in advance!
Photo of David Dobish

David Dobish, Senior QE Photoshop

  • 200 Posts
  • 51 Reply Likes
I do not have access to tberry's folder so I cannot upload a new script that fixes this issue.

Change this line"

// Open Souce=======================================================
var fileList = File.openDialog("Select a source files", null, true);

To this:

// Open Souce=======================================================
var fileList = File.openDialog("Select a source files", true);

It is toward the top of the script.

Save the script back out and it should work for you.
Photo of Juerg Schmidlin

Juerg Schmidlin

  • 2 Posts
  • 0 Reply Likes
thanks a lot!
Photo of David Dobish

David Dobish, Senior QE Photoshop

  • 200 Posts
  • 51 Reply Likes
No Problem
Photo of Jeffrey Tranberry

Jeffrey Tranberry, Sr. Product Manager, Digital Imaging

  • 15504 Posts
  • 2306 Reply Likes
Sorry, I was probably out on paternity leave when this issue came up. I updated the script on my website with Dave's change. Should be set to go for anyone else wanting to download this.
Photo of Rob Georgiou

Rob Georgiou

  • 1 Post
  • 0 Reply Likes
I get an error when using this script:

' The target "photoshop" is unknown! Do you want to open the file for editting? '

Can anyone shed some light on this error?