![見出し画像](https://assets.st-note.com/production/uploads/images/108864607/rectangle_large_type_2_0616adb1bec5175faf9020cf665a1a85.png?width=1200)
【素材化】簡単に自動で背景切り抜き・マスク作成するよ[Transparent Background]
動画や漫画制作してると背景が透明の画像やAI生成してるとマスク画像が欲しい時があります
ネットを探すのもいいですが、自前で準備したほうが結果早かったり、自作の工程の中でそういう処理をすることも多いので、コマンドライン実行にはなりますがTransparent Backgroundを使った方法を記述します
公式GITHUB
インストールはコマンドプロンプトで
pip install transparent-background
使い方
①背景透過したい画像を好きなフォルダに入れる
![](https://assets.st-note.com/img/1687381164769-KjjkjXWj3O.png?width=1200)
②アドレスに[cmd]と入力しEnter
![](https://assets.st-note.com/img/1687381207083-BvaQqYZFL3.png)
③コマンドを入力
コマンドプロンプトが立ち上がるので
「transparent-background --source 〇〇」
を入力。〇〇の部分にファイル名を入れる。今回の画像は
「01624-148460380.png」なので
「transparent-background --source 01624-148460380.png」
を入力する
以上で終わりです。簡単ですね
![](https://assets.st-note.com/img/1687381771169-t80cgF5kmp.png?width=1200)
![](https://assets.st-note.com/img/1687381809392-kIStIhlrdD.png)
![](https://assets.st-note.com/img/1687381849996-4yyCILkTOq.png)