Download the PHP package mtownsend/remove-bg without Composer

On this page you can find all versions of the php package mtownsend/remove-bg. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package remove-bg

Programmatically remove backgrounds from your images using the remove.bg api.

Installation

Install via composer:

This package is designed to work with any PHP 7.0+ application but has special support for Laravel.

Registering the service provider (Laravel users)

For Laravel 5.4 and lower, add the following line to your config/app.php:

For Laravel 5.5 and greater, the package will auto register the provider for you.

Using Lumen

To register the service provider, add the following line to app/bootstrap/app.php:

Publishing the config file (Laravel users)

`

Once your removebg.php has been published your to your config folder, add the api key you obtained from Remove.bg. If you are using Laravel and put your remove.bg api key in the config file, Laravel will automatically set your api key every time you instantiate the class through the helper or facade.

Quick start

Using the class

Advanced usage

Remove.bg offers several request body parameters for each api call. For an up to date list, you should always check the remove.bg api documentation.

Here is an example of an api call configured with specific request body parameters.

``

You may also directly specify request header parameters. As of right now this does not appear to offer much functionality in terms of how the Remove.bg api will consume these headers, but we thought it was important to expose this functionality. Consider the following example:

``

Account details

The Remove.bg api offers an endpoint to check your account's credit balance and free api call usage. If your application needs to check your available credits before processing images this package makes it an absolute breeze!

The following code example is how you can programmatically check your account information. Note, the account method has one optional argument: $getResponseAsObject = true. By default your response will be returned as an object. You can return the response as an associative array by passing false to the account(false) method.

``

To access your total credits you could do so like this: $account->data->attributes->credits->total.

A practical example could look something like the following:

``

Using the global helper (Laravel users)

If you are using Laravel, this package provides a convenient helper function which is globally accessible.

Using the facade (Laravel users)

If you are using Laravel, this package provides a facade. To register the facade add the following line to your config/app.php under the aliases key.

``

Credits

Testing

Tests coming soon...

You can run the tests with:

License

The MIT License (MIT). Please see License File for more information.


All versions of remove-bg with dependencies

PHP Build Version
Package Version
Requires php Version ~7.0|~8.0
guzzlehttp/guzzle Version ^7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mtownsend/remove-bg contains the following files

Loading the files please wait ....