We just setup a new Switch flow using the amazing service remove.bg for removing backgrounds on all kind of images. I though I would share this here if anyone else would like to know how to setup a similar flow (since the HTTP request setup imho is a bit tricky).
1. Register an account on https://remove.bg and buy some credit or an subscription.
2. On the remove.bg account choose API and generate a API key
3. Use the flow element HTTP Request and do the following parameters:
a. URL: https://api.remove.bg/v1.0/removebg
b. Request type: POST
c. Attached file: [Job.Path]
d. Use MIME encoding: YES
e. File varible: image_file
f. Authentication scheme: none
g. Parameters: size=auto (here you can choose your wanted parameters from remove.bg API documentation)
h. Headers: X-API-Key: YOUR-API-KEY-HERE
i. Response: Inject as new job
j. Filename: [Job.NameProper].png
k. Input job: discard
4. Done
Enjoy!
Using Remove.bg for image background removal (tutorial)
- magnussandstrom
- Advanced member
- Posts: 364
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Using Remove.bg for image background removal (tutorial)
Last edited by magnussandstrom on Mon Sep 13, 2021 12:38 pm, edited 1 time in total.
-
- Newbie
- Posts: 9
- Joined: Mon Mar 25, 2019 11:15 am
Re: Using Remove.bg for image background removal
Thank you very much, Magnus.
It was very helpful.
Have you found a way to handle zip output files?
Zip files contain 2 files: color.jpg and alpha.png which must be combined into one photoshop file
It was very helpful.
Have you found a way to handle zip output files?
Zip files contain 2 files: color.jpg and alpha.png which must be combined into one photoshop file
- magnussandstrom
- Advanced member
- Posts: 364
- Joined: Thu Jul 30, 2020 6:34 pm
- Location: Sweden
- Contact:
Re: Using Remove.bg for image background removal
Hi Lars, happy that it works for you!
I have not yet tried to utilize the ZIP option from Background.bg. But it should be possible to merge the two files with ImageMagick within Switch.
In our flow we shrink files larger then 25 mp to 25 mp with ImageMagick before routing to Remove.bg.
I have not yet tried to utilize the ZIP option from Background.bg. But it should be possible to merge the two files with ImageMagick within Switch.
In our flow we shrink files larger then 25 mp to 25 mp with ImageMagick before routing to Remove.bg.
-
- Newbie
- Posts: 9
- Joined: Mon Mar 25, 2019 11:15 am
Re: Using Remove.bg for image background removal (tutorial)
Thanks, I'll try with ImageMagick
Re: Using Remove.bg for image background removal (tutorial)
Thank you very much, Magnus.
It was very helpful.but can you help me configure for web pixian.ai, this is my propertive
a. URL: https://api.pixian.ai/api/v2/remove-background
b. Request type: POST
c. Attached file: [Job.Path]
d. Use MIME encoding: YES
e. File varible: image_file
f. Authentication scheme: none
g. Parameters: size=auto (here you can choose your wanted parameters from remove.bg API documentation)
h. Headers: X-API-Key: my API secrect
i. Response: Inject as new job
j. Filename: [Job.NameProper].png
k. Input job: discard
4. Done
when I register at pixian, my API key includes API id and APi serect, I use API serect for the header and get the error " Request finish status: Failed; status code: 400; status description: Bad Request; last error: HTTP protocol error. 400 Bad Request. " from Swich
It was very helpful.but can you help me configure for web pixian.ai, this is my propertive
a. URL: https://api.pixian.ai/api/v2/remove-background
b. Request type: POST
c. Attached file: [Job.Path]
d. Use MIME encoding: YES
e. File varible: image_file
f. Authentication scheme: none
g. Parameters: size=auto (here you can choose your wanted parameters from remove.bg API documentation)
h. Headers: X-API-Key: my API secrect
i. Response: Inject as new job
j. Filename: [Job.NameProper].png
k. Input job: discard
4. Done
when I register at pixian, my API key includes API id and APi serect, I use API serect for the header and get the error " Request finish status: Failed; status code: 400; status description: Bad Request; last error: HTTP protocol error. 400 Bad Request. " from Swich