npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cutoutbg

v4.2.0

Published

Remove image background

Downloads

11

Readme

Cutout-bg

Remove Image Background

安装教程

  1. 使用npm下载cutoutbg包

    npm i/install cutoutbg -g

配置Cutoutbg的key

  1. Windows系统:

    C:\Users\USER_NAME\.cutoutbg\key.json	(例:C:\Users\nicholas\.cutoutbg\key.json)
    在本机系统用户名文件夹下建一个.cutoutbg的文件夹,下面建一个key.json文件,内容如下:
    {
        "apiKey": "Edjkb***************Qiuy"
    }
  2. Linux、Unix 和 macOS

    ~/.cutoutbg/key.json	(例:/Users/nicholas/.cutoutbg/key.json)
    在本机系统用户名文件夹下建一个.cutoutbg的文件夹,下面建一个key.json文件,内容如下:
    {
        "apiKey": "Edjkb***************Qiuy"
    }

使用教程

  1. 处理本地图片(-s 表示要处理图片的文件夹路径,结果会放在源文件下创建一个新的文件夹,新文件夹格式:result-yyyy.MM.dd-HH.mm.ss)

    cutoutbg -s C:\Users\nicholas\Desktop\test\images
  2. 处理Amazon在线图片(-s 表示要处理图片的文件夹路径,-t 表示处理后的图片放入的文件夹路径(此文件夹必须存在),目标文件下会创建一个新的文件夹,新文件夹格式:result-yyyy.MM.dd-HH.mm.ss)

    cutoutbg -s "https://www.amazon.com/dp/B06Y5TVV2B?ref_=pfb_24dkhe2485gcdmk2nbc9hfcg3c94" -t C:\Users\nicholas\Desktop\test

    注意: 对于Amazon地址类型,必须要用双引号把地址包裹起来,因为URL地址有效符号会和命令行参数相冲突,而且在命令行必须使用双引号,单引号不会被识别。

  3. 配置文件处理图片(-s 表示配置文件路径,必须为json文件格式)

    cutoutbg -s c:\Users\nicholas\Desktop\test\test.json

    json配置文件格式如下:

    {
        "url": {
            "source": [
                "https://www.amazon.com/dp/B06Y5TVV2B?ref_=pfb_24dkhe2485gcdmk2nbc9hfcg3c94",
                "https://www.amazon.com/Amazon-Brand-Solimo-Kitchen-Drawstring/dp/B07BJ4D1W1/?tag=fbxcmeaxcm-20&ascsubtag=xfb-XCMEMR-1-9-58fioplyxyg9qpwd&ref_=xfb_XCMEMR_1_9_58fioplyxyg9qpwd"
            ],
            "target": "E:/XXX/XXX/"
        },
        "local": {
            "source": [
                "E:/XXX/XXX/Images",
                "E:/XXXX/XXXX/Images"
            ]
        }
    }

    | 类型 | | 属性 | 属性说明 | | ----- | -------------- | ------ | -------------------------------------------------- | | url | Amazon在线地址 | source | Amazon在线地址的数组集合,类型必须为数组 | | | | target | 下载后和处理后的文件存放的路径,类型必须为字符串 | | local | 本地处理的图片 | source | 本地需要处理的图片所在文件夹的路径,类型必须为数组 |

    url类型和local类型必须存在一个或两个。

  4. 对于只想下载Amazon网站的图片而不想移除下载图片的背景,则可以加上-d的参数,表示只下载图片不移除图片背景,此参数只针对URL类型起效

    cutoutbg -s "https://www.amazon.com/dp/B06Y5TVV2B?ref_=pfb_24dkhe2485gcdmk2nbc9hfcg3c94" -t C:\Users\nicholas\Desktop\test -d
       
    // 只针对json文件配置的url类型地址起效,本地图片还是会被处理
    cutoutbg -s c:\Users\nicholas\Desktop\test\test.json -d
  5. 支持在线下载图片和视频文件

  6. 使用cutoutbg --help可以查看各个命令的解释说明