承接 draco-development-group/remove-bg 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

draco-development-group/remove-bg

Composer 安装命令:

composer require draco-development-group/remove-bg

包简介

A very small library to use your remove.bg api key to remove the background from your images and give you a transparent png

README 文档

README

To install:

composer require draco-development-group/remove-bg

Quick Start:

Use the class

// Remember to require the composer autoloader
require_once __DIR__ . '/../vendor/autoload.php';

use DracoDevelopmentGroup\RemoveBg;

$bg = new RemoveBg('YOUR_API_KEY');

$bg->setOutputImageName('path/to/save/new/image/image_name', 'optionalFileType(.jpg or .png)');
$bg->setImageUrl('https://path/to/image.jpg');
$bg->save();

Full Documentation

You can set images from urls, or directly upload the image, or give a base64_encoded image:

  • You may only use one of the following. If you attempt to use one of these after already setting an image, it will keep the last value you used.
    $bg->setImageUrl(string);
    $bg->setImageFile(string($binary));
    $bg->setImageFileB64(string);
    

    You can set backgrounds from urls, or directly upload the image, or give a color:

  • You may only use one of the following. If you attempt to use one of these after already setting an image, it will keep the last value you used.
    $bg->setBgColor(string); //can be hex or color name
    $bg->setBgImageUrl(string);
    $bg->setBgImageFile(string($binary));
    

You can set the following parameters as well

$bg->setSize(string); // preview (default), full, auto, etc
$bg->setType(string); //auto, person, product, car
$bg->setFormat(string); //auto, jpg, png
$bg->setRoi(string); //rectangle as x/y coordinates, <x1> <y1> <x2> <y2>
$bg->setCrop(boolean); //default false
$bg->setChannels(string); //rgba default

Full documentation also available in the class file

License

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

统计信息

  • 总下载量: 158
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固