Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var APIENDPOINT = "https://api.remove.bg/v1.0/removebg"
Functions ¶
This section is empty.
Types ¶
type RemoveBG ¶
type RemoveBG struct {
APIKey string
}
func NewRemoveBG ¶
func (*RemoveBG) RemoveFromBase64 ¶
func (rb *RemoveBG) RemoveFromBase64(base64 string, opt *RemoveOption) error
func (*RemoveBG) RemoveFromFile ¶
func (rb *RemoveBG) RemoveFromFile(filePath string, opt *RemoveOption) error
func (*RemoveBG) RemoveFromURL ¶
func (rb *RemoveBG) RemoveFromURL(url string, opt *RemoveOption) error
type RemoveOption ¶
type RemoveOption struct { // Size of the output image (`'auto'` = highest available resolution, `'preview'`|`'small'`|`'regular'` = 0.25 MP, `'medium'` = 1.5 MP, `'hd'` = 4 MP, `'full'`|`'4k'` = original size) Size string // Type foreground object (`'auto'` = autodetect, `'person'`, `'product'`, `'car'`) Type string // TypeLevel classification level of the foreground object (`'none'` = no classification, `'1'` = coarse classification (e.g. `'car'`), `'2'` = specific classification (e.g. `'car_interior'`), `'latest'` = latest classification) TypeLevel string // Format image format (`'auto'` = autodetect, `'png'`, `'jpg'`, `'zip'`) Format string // ROI region of interest, where to look for foreground object (x1, y1, x2, y2) in px or relative (%) ROI string // Crop px or relative, single val = all sides, two vals = top/bottom, left/right, four vals = top, right, bottom, left Crop string // Scale image scale relative to the total image size Scale string // Position `'center'`, `'original'`, single val = horizontal and vertical, two vals = horizontal, vertical Position string // Channels request the finalized image (`'rgba'`) or an alpha mask (`'alpha'`) Channels string // Shadow whether to add an artificial shadow (some types aren't supported) Shadow bool // Semitransparency for windows or glass objects (some types aren't supported) Semitransparency bool // Background (`None` = no background, path, url, color hex code (e.g. `'81d4fa'`, `'fff'`), color name (e.g. `'green'`)) Background string // Background type (`None` = no background, `'path'`, `'url'`, `'color'`) BackgroundType string NewFileName string }
func NewRemoveOption ¶
func NewRemoveOption() *RemoveOption
Click to show internal directories.
Click to hide internal directories.