semvec/pypi-packages huggingface dataset:
removebg-remould 0.0.0
removebg-remould
Requires Python: >=3

## removebg-remould

Only remould the removebg

remove_background_from_img_file(self, img_file_path, save_file_path, size="regular", bg_color=None)

```python
from __future__ import absolute_import
import requests
import logging

API_ENDPOINT = "https://api.remove.bg/v1.0/removebg"

class RemoveBg(object):

    def __init__(self, api_key, error_log_file):
        self.__api_key = api_key
        logging.basicConfig(filename=error_log_file)

    def remove_background_from_img_file(self, img_file_path, save_file_path, size="regular", bg_color=None):
        img_file = open(img_file_path, 'rb')
        response = requests.post(
            API_ENDPOINT,
            files={'image_file': img_file},
            data={
                'size': size,
                'bg_color': bg_color
            },
            headers={'X-Api-Key': self.__api_key})
        response.raise_for_status()
        self.__output_file__(response, save_file_path+"_nobg.png")

        img_file.close()

```