module RemoveBg

Constants

VERSION

Public Class Methods

account_info(raw_options = {}) click to toggle source

Fetches account information for the globally configured API key, or a specific API key if provided @param options [Hash<Symbol, Object>] @return [RemoveBg::AccountInfo]

# File lib/remove_bg.rb, line 32
def self.account_info(raw_options = {})
  options = RemoveBg::BaseRequestOptions.new(raw_options)
  ApiClient.new.account_info(options)
end
configure() { |configuration| ... } click to toggle source

Yields the global Remove.bg configuration @yield [RemoveBg::Configuration]

# File lib/remove_bg.rb, line 39
def self.configure
  yield RemoveBg::Configuration.configuration
end
from_file(image_path, raw_options = {}) click to toggle source

Removes the background from an image on the local file system @param image_path [String] Path to the input image @param options [Hash<Symbol, Object>] Image processing options (see API docs) @return [RemoveBg::Result|RemoveBg::CompositeResult] a processed image result

# File lib/remove_bg.rb, line 12
def self.from_file(image_path, raw_options = {})
  options = RemoveBg::RequestOptions.new(raw_options)
  ApiClient.new.remove_from_file(image_path, options)
end
from_url(image_url, raw_options = {}) click to toggle source

Removes the background from the image at the URL specified @param image_url [String] Absolute URL of the input image @param options [Hash<Symbol, Object>] Image processing options (see API docs) @return [RemoveBg::Result|RemoveBg::CompositeResult] A processed image result

# File lib/remove_bg.rb, line 22
def self.from_url(image_url, raw_options = {})
  options = RemoveBg::RequestOptions.new(raw_options)
  ApiClient.new.remove_from_url(image_url, options)
end