Animated data flow diagram

AI Agent: Automated Image Background Removal (Google Drive & Photoroom)

Version: 1.0.0 | Last Updated: 2025-05-16

Integrates with:

Google Drive Photoroom

Overview

Unlock Studio-Quality Images Automatically with this AI Agent\nThis n8n workflow acts as an intelligent agent that monitors a specified Google Drive folder for new image uploads. Once an image is detected, it's downloaded, and its background is professionally removed using the Photoroom API. You can customize the background (color or transparent) and add padding. The final, polished image (as a PNG) is then automatically uploaded to a designated output folder in your Google Drive, streamlining your image preparation pipeline.\n\n### Key Features & Benefits\n* AI-Powered Background Removal: Leverages Photoroom's advanced AI for precise and clean background removal, giving your images a professional look.\n* Google Drive Integration: Seamlessly watches for new images in an input folder and saves processed images to an output folder within your Google Drive.\n* Customizable Output:\n * Set a specific background color (e.g., 'white', 'transparent', hex codes like '#F0F0F0').\n * Add adjustable padding around the subject (e.g., '5%').\n * Choose to keep the original image dimensions or resize to a fixed output size (e.g., '1600x1600').\n* Fully Automated Workflow: Set it up once and let it handle image processing 24/7, freeing up your time for other tasks.\n* Batch Processing Ready: Designed to handle images efficiently, even in batches.\n* Standardized Output: Ensures all your images have a consistent, professional appearance by saving them as PNG files.

Use Cases

  • B2C E-commerce: Automatically prepare clean, consistent product photos for online stores by removing distracting backgrounds.
  • B2B SaaS: Create professional-looking visuals for marketing materials, presentations, and website content without manual editing.
  • Content Creators: Quickly process images for social media posts, blog articles, or thumbnails with transparent or custom backgrounds.
  • Marketing Agencies: Streamline image editing workflows for client projects, ensuring quick turnaround for campaign assets.

Prerequisites

  • An n8n instance (Cloud or self-hosted).
  • A Photoroom API Key (obtainable from photoroom.com/api).
  • Google Drive credentials configured within your n8n instance.
  • The URL of a Google Drive folder to serve as the output destination for processed images.
  • A designated Google Drive input folder to monitor for new images.

Setup Instructions

  1. Download the n8n workflow JSON file.
  2. Import the workflow into your n8n instance.
  3. Configure the 'Watch for new images' (Google Drive Trigger) node: Select your Google Drive credentials and specify the input folder to monitor (you can use the folder ID or URL).
  4. Ensure your Google Drive credentials are also selected in the 'Download Image' node.
  5. Navigate to the 'Config' node and set the following parameters:
    • api-key: Enter your Photoroom API Key.
    • bg_color: Define the background for the processed image (e.g., 'white', 'transparent', or a HEX color code like '#FFFFFF').
    • padding: Specify the padding around the subject (e.g., '5%').
    • keepInputSize: Set to true to maintain the original image dimensions. Set to false if you want to use a custom outputSize.
    • outputSize: If keepInputSize is false, define the fixed output dimensions (e.g., '1600x1600'). This field is ignored if keepInputSize is true.
    • OutputDriveFolder: Enter the full URL of the Google Drive folder where processed images will be saved.
  6. Verify that your Google Drive credentials are selected in both the 'Upload Picture to Google Drive' and 'Upload Picture to Google Drive1' nodes. The output folder is dynamically set based on your 'Config' node settings.
  7. Activate the workflow. New images added to your monitored Google Drive input folder will now be automatically processed.

Tags:

AI AgentImage ProcessingBackground RemovalGoogle DrivePhotoroomAutomationE-commerceMarketing AutomationProductivity

Want your own unique AI agent?

Talk to us - we know how to build custom AI agents for your specific needs.

Schedule a Consultation