Photomerge two documents with API

Hi,

I read the documentation and I know it is explicitly mentioned that working with multiple documents is not supported currently.

But usually, when things are not natively supported - there are some workarounds and I was wondering if there is any workaround for this? I just want to automate a process where I can pass in two images via API and get a single photomerged image back.

Any way this could be possible?

Where is it mentioned that you can’t use multiple documents? In fact, the first example on the API doc’s for Photoshop document specifically shows how to open two docs. You can easily open each image separately, duplicate one of them over to the other and then merge.

Hi,

Thank you for your reply.

Sorry, I couldn’t find the example on the link that you shared. I feel so dumb asking for it, but can you please let me know exactly where to look?

This is where I read Known Limitations that I can’t work with multiple docs in actions. Maybe the link you share will help me achieve what I want.

Thanks,
Karan

I think we’re talking about different APIs :grin: I was referring to the UXP API, for plugins. It sounds like you want to use the REST API?

Yes, I want to use REST APIs

Ah, gotcha. I apologize, I think that particular API does have limitations as you noted yourself. I’m not super familiar with that API. Maybe someone else here is. That said, have you taken a look at the examples code page? It looks like you can specify multiple image inputs for your action JSON. Another option also would be to have one of the images be your input psd and then add the other image as a smart object layer and then execute actions to merge.

Hi,

Managed to solve this. I simply created a new document with two layers, each layer carrying the image file I needed for merging.

Thanks for your help,
Karan

1 Like