1. Introduction
Use PS for cutout?
Use magic wand and quick selection tool?
What to do if you encounter a complicated background?
Recently discovered a magic tool-Remove Image Background
https://www.remove.bg/zh
It is developed based on Python, Ruby and deep learning technology. It automatically recognizes the foreground subject and background image through a powerful AI artificial intelligence algorithm, and completes the matting in seconds.
There are two simple ways for this cutout tool:
1、 Online cutout
2、 API code cutout
2. Online Cutout
1、 Open the homepage of the remove.bg website, you can upload local pictures, or you can select the URL link of the network picture.
2、 A few seconds after uploading, you can see the transparent image without background.
3、 You can edit the image, add the background of various scenes, or replace it with a solid color background, and then download it.
It also supports client-side Windows, Mac, Linux and PS plug-ins, and can also introduce APIs into its own programs for batch processing.
Three, code cutout
1、 View API key
A registered account is required to obtain the key.
After successful registration, you can log in to view your API key.
The default generated image format size is standard, and up to 50 photos are processed for free each month, and each size does not exceed 25MB.
If you want to generate high-definition or process more pictures, you need to pay (there is no limit on the number of times of online matting).
2、 Install extension library
pip install removebg
3、 Code usage guidelines
https://github.com/brilam/remove-bg
#! /usr/bin/env python3
# - *- coding:utf-8-*-
# Author : MaYi
# Blog : http://www.cnblogs.com/mayi0312/
# Date :2020-03-03
# Name : test_cutout
# Software : PyCharm
# Note :AI automatic cutout
from removebg import RemoveBg
rmbg =RemoveBg("YOUR-API-KEY","error.log") #The first quote is the API you obtained
rmbg.remove_background_from_img_file("gitpython.jpg") #The map's address
# Entry function
if __name__ =='__main__':
pass
operation result:
Four, summary
This article describes two ways:
1、 Online cutout
2、 API code cutout
Different methods can be selected according to needs.
If you want to use it yourself, you can cut out the image online; if you want to batch process, you can try the code to get it.
The above is the whole content of this article, I hope it will be helpful to everyone's study.
Recommended Posts