How to process images from Google Drive using Zapier

Zapier is a popular no-code tool that allows you to easily integrate and automate multiple tools.

In this tutorial, you'll learn how to use Zapier to create an integration that:

  1. Watches a Google Drive folder to detect new images

  2. Sends the new images to the Image Editing API

  3. Saves the result of the API call to another Google Drive folder

Step 1: Watching a Google Drive folder

In Zapier, first create a new Zap, click to configure its Trigger and then select Google Drive:

Then, select the event New File in Folder:

Next, configure the connection to your Google Drive account and select the Folder where you will deposit the images that you want to process:

Step 2: Processing Images through the Image Editing API

Now that you've configured the event that will trigger your Zap, it's time to configure the action that your Zap will execute.

To do this, click on Action, search for "Photoroom" and pick Photoroom (latest):

Next, you'll set the Event to choose which API you want to call.

In this tutorial, we want to call the Image Editing API:

As you can notice, our Zapier integration also allows you to call our Remove Background API.

Then, you'll need to input your API key so that Zapier can call the Photoroom API on your behalf:

If you don't have an API key, here are the steps to create yours.

Finally, you need to configure the parameters of the API call.

First, you'll set the value of the imageFile argument to be the data of the file that has been added to the Google Drive folder:

Then, you can also add additional fields for the edits that you want to apply to the image.

Here we're setting an outputSize of 1000x1000 and a padding of 10%:

Step 3: Uploading the Result to Google Drive

You're almost finished, now you just need to upload the image returned by the Image Editing API back to Google Drive.

To do this, you'll add a new Google Drive Step:

Then, to configure this Action, you'll first set the Event to Upload File:

And then you'll set:

  • the Drive and Folder where we want to save the result

  • the content of the File to the data returned by the API call

  • the File Name to that of the original file

Step 4: Testing the Integration

That's it, you've finished implementing your Zap!

You can click to Publish it:

And now that your Zap has been published, it's time to test it!

To do this, you'll simply add some images to the Google Drive folder that your Zap has been configured to watch:

And then you can move to the folder that's been configured to receive the results and after a few moments you'll see the processed images appear:

Conclusion

In this tutorial, we saw how to use Zapier to easily integrate Google Drive with the Photoroom API.

We took the example of watching a Google Drive folder and automatically processing images through the Image Editing API, but it's of course possible to modify the workflow to:

  • replace Google Drive with another storing service

  • call another Photoroom API, like the Remove Background API

  • add additional steps to run some logic specific to your use case

Last updated