PHPackages                             acetonesoft/acetone-api-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. acetonesoft/acetone-api-php

ActiveLibrary[API Development](/categories/api)

acetonesoft/acetone-api-php
===========================

PHP class for API of AceTone.AI - remove background form your images

v1.0.0b(2y ago)34MITPHPPHP &gt;=7.4

Since Jul 30Pushed 2y ago1 watchersCompare

[ Source](https://github.com/acetonesoft/acetone-api-php)[ Packagist](https://packagist.org/packages/acetonesoft/acetone-api-php)[ RSS](/packages/acetonesoft-acetone-api-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

PHP Client for API of AceTone.ai
================================

[](#php-client-for-api-of-acetoneai)

You can programmatically remove backgrounds from your images using the API of AceTone.ai. Also you can fill background by solid color, by gradient or radial gradient. Or you can replace background by other image.

**IMPORTANT:** You need register an account and obtain your API key on the

[![cover](cover.jpg)](cover.jpg)

Installation
------------

[](#installation)

Install via composer

```
composer require avadim/acetone-api-php

```

Quick Start
-----------

[](#quick-start)

```
use avadim\Acetone\AcetoneApi;

$acetone = new AcetoneApi($apiKey);
$acetone->fromFile($sourceImageFile)->save($targetImageFile);
```

Advanced Usage
--------------

[](#advanced-usage)

### Sources

[](#sources)

The image can be obtained from a link, from a file, from a binary string, or from a base64-string

```
// Get source image from URL
$acetone->fromUrl($imageUrl)->save($outFile);

// Get source image from file
$acetone->fromFile($imageFile)->save($outFile);

// Get image from binary string
$acetone->fromString($imageString)->save($outFile);

// Get image as a base64-string
$acetone->fromBase64($base64)->save($outFile);
```

### Manipulations With Background

[](#manipulations-with-background)

```
// Just remove background
$acetone->fromFile($imageUrl)->bgRemove()->save($outFile);

// Set background color
$acetone->fromFile($imageUrl)->bgColor('f00')->save($outFile);
$acetone->fromFile($imageUrl)->bgColor('#f00')->save($outFile);
$acetone->fromFile($imageUrl)->bgColor([255,0,0])->save($outFile);

// Fill background by a linear gradient
$colors = ['f00', '33c'];
$vector = -30;
$acetone->fromFile($imageUrl)->bgRadialGradient($colors, $vector)->save($outFile);

// Fill background by a radial gradient
$colors = ['f00', '33c'];
$center = [120, 240];
$acetone->fromFile($imageUrl)->bgGradient($colors, $center)->save($outFile);

// Set grayscale mode of background
$acetone->fromFile($imageUrl)->bgGrayscale()->save($outFile);

// Set background image from binary string
$bgImageFile = 'path/to/new/background';
$bgImage = file_get_contents($bgImageFile);
$acetone->fromFile($imageUrl)->bgImage($bgImage)->save($outFile);

// Or set background image from file
$bgImageFile = 'path/to/new/background';
$acetone->fromFile($imageUrl)->bgImageFile($bgImage)->save($outFile);
```

### Resize Result Image

[](#resize-result-image)

```
$acetone->fromFile($imageFile)
    ->size(800, 600, AcetoneApi::IMG_FIT_COVER, AcetoneApi::IMG_FIT_COVER)
    ->bgImageFile($imageFileBg)
    ->save($outFile);
```

### Crop Result Image to Foreground Fit

[](#crop-result-image-to-foreground-fit)

```
$acetone->fromFile($imageFile)
    ->crop()
    ->get();
```

### Get Result Image as a Binary String

[](#get-result-image-as-a-binary-string)

```
// You can define output format - png, jpg or webp (png is default)
$imageStr = $acetone->fromFile($imageFile)->get('webp');
$image = imagecreatefromstring($imageStr);
// Some manipulations
imagejpeg($im, 'image.jpg');
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1023d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bdb51a3c707497a4cc826ec61af31a3f33f2a372d8245e1d17a51be913d1c916?d=identicon)[avadim](/maintainers/avadim)

---

Top Contributors

[![aVadim483](https://avatars.githubusercontent.com/u/2246758?v=4)](https://github.com/aVadim483 "aVadim483 (5 commits)")

---

Tags

phpapiimageaibackgroundphotoremovebgtransparent

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/acetonesoft-acetone-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/acetonesoft-acetone-api-php/health.svg)](https://phpackages.com/packages/acetonesoft-acetone-api-php)
```

###  Alternatives

[mtownsend/remove-bg

A PHP package to interface with the remove.bg api.

183315.4k](/packages/mtownsend-remove-bg)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
