bgCut.net for PHP SDK (Composer)

PHP 8.1+

Official open-source PHP library: remove a background in three lines, with typed results and errors. MIT licence.

Download GitHub

Installation

  1. composer require bgcut-net/bgcut-php (or copy the src/ folder and require_once 'src/autoload.php';).
  2. $bg = new BgCut\Client('bgc_…');
  3. $bg->removeToFile('photo.jpg', 'photo-nobg.png');
  4. Six ready-to-run examples (single file, URL with white background, blur, bulk folder, account, upload form) are in the examples/ folder on GitHub.

Your API key

Every integration needs an API key from your account:

Get an API key

Other integrations