wideangle_1234's profile

4 Messages

 • 

120 Points

Sat, Apr 16, 2011 12:56 PM

Closed

Photoshop: Automatic Crop after Panorama / Photomerge ?

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

Official Solution

Adobe Administrator

 • 

16K Messages

 • 

296.7K Points

11 y ago

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.

2 Messages

 • 

74 Points

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!

4 Messages

 • 

120 Points

11 y ago

Apologies, attaching image....

15.1K Messages

 • 

195.8K Points

11 y ago

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.

4 Messages

 • 

120 Points

11 y ago

Thanks, Chris, appreciate the consideration.

Adobe Administrator

 • 

197 Messages

 • 

4.1K Points

11 y ago

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.

4 Messages

 • 

120 Points

11 y ago

David, that would be very useful given the hundreds of images I have to go through! Any help would be appreciated.

Adobe Administrator

 • 

197 Messages

 • 

4.1K Points

11 y ago

I posted some code that did not work so I removed it. I will work on it some more.

Adobe Administrator

 • 

16K Messages

 • 

296.7K Points

I posted Dave's script here:

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

Right click on the link to download.

Essentially what it does is display a dialog for you to select the images to Photomerge. It does the Photomerge, then flattens the image and uses content aware fill to fill in the areas of the pano that are missing.

Sr. Product Manager, Adobe Digital Imaging

Adobe Administrator

 • 

197 Messages

 • 

4.1K Points

10 y ago

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.

2 Messages

 • 

74 Points

thanks a lot!

Adobe Administrator

 • 

197 Messages

 • 

4.1K Points

No Problem

Adobe Administrator

 • 

16K Messages

 • 

296.7K Points

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.

Sr. Product Manager, Adobe Digital Imaging

1 Message

 • 

60 Points

9 y ago

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?