Hi dear owners!


For an easier, faster, and less expensive method please check out our Cloud services





In the next article, we will explain to you how to incorporate a script that we have created and use Remove.bg in order to remove the background without using an actual green screen.


To use this feature, you need to make sure you have a stable internet connection.


TABLE OF CONTENTS


Get an API:
1. Register to Remove.bg

2. Using your account, generate an API key. Go to Tools & API on the website and then choose API Documentation:



3. Click on Get API:


4. Copy and paste the API that was generated for you and save it in a text file for future use.


Implementing the API: 

1. Open a new text document file and copy and paste the following script into it:
rename %1 temp.jpg
curl -H "X-API-Key: YOUR_API_KEY" -F "image_file=@C:\MirrorMeBooth\Events\MyFirstEvent\raw\temp.jpg" -F "size=auto" -f "https://api.remove.bg/v1.0/removebg" -o "%1"
del "C:\MirrorMeBooth\Events\MyFirstEvent\raw\temp.jpg"


2. Replace the  YOUR_API_KEY with your key.


3. Replace  C:\MirrorMeBooth\Events\MyFirstEvent\raw\temp.jpg with "{Your_Event_Full_Path}\raw\temp.jpg" (both in the 2nd and 3rd line)


See a screenshot for example below:



4. Save the file as bg.bat 


Make sure to place the .bat file in the Raw folder of your used Event folder



Photo Layout Setup:

Even if you are using a vertical photo preset (DSLR_270/90) you set the DLSR element in the photo layout tab to 0 degrees angle and make sure that the Height of the photo is bigger than the width, and the ratio should be 0.66667


Add the desired background photo and place it behind the DSLR element in the Photo Layout tab



Workflow Setup:

1. Add an External Script state in your workflow and load the .bat file created.


2. Add another Feature state of Reload Raw Photos. Make sure to place at least one animation state in between, to give a short time buffer so the script will be applied (it takes ~5 seconds)


That's it!