{"id":39629501,"url":"https://github.com/remove-bg/ruby","last_synced_at":"2026-01-18T08:41:41.193Z","repository":{"id":56891740,"uuid":"174733251","full_name":"remove-bg/ruby","owner":"remove-bg","description":"Official ruby gem for the remove.bg API","archived":false,"fork":false,"pushed_at":"2026-01-14T13:36:01.000Z","size":2877,"stargazers_count":34,"open_issues_count":1,"forks_count":12,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-14T14:23:08.565Z","etag":null,"topics":["background-removal","image-processing","ruby"],"latest_commit_sha":null,"homepage":"https://www.remove.bg/api","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remove-bg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-03-09T18:46:50.000Z","updated_at":"2026-01-14T11:01:30.000Z","dependencies_parsed_at":"2024-04-22T12:25:16.799Z","dependency_job_id":"f5e2e9dc-51a8-41b3-939c-2cdecf0f3b40","html_url":"https://github.com/remove-bg/ruby","commit_stats":{"total_commits":96,"total_committers":3,"mean_commits":32.0,"dds":0.02083333333333337,"last_synced_commit":"eb12e12b79bbf9f7d34e96949660e269faf72f6e"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/remove-bg/ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remove-bg%2Fruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remove-bg%2Fruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remove-bg%2Fruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remove-bg%2Fruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remove-bg","download_url":"https://codeload.github.com/remove-bg/ruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remove-bg%2Fruby/sbom","scorecard":{"id":770480,"data":{"date":"2025-08-11","repo":{"name":"github.com/remove-bg/ruby","commit":"7bbb540c7f1d807265612ab5a31045dd0e6b1d4f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.2,"checks":[{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Maintained","score":5,"reason":"7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/10 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: all commits (21) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T02:06:56.617Z","repository_id":56891740,"created_at":"2025-08-23T02:06:56.618Z","updated_at":"2025-08-23T02:06:56.618Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28534148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["background-removal","image-processing","ruby"],"created_at":"2026-01-18T08:41:40.400Z","updated_at":"2026-01-18T08:41:41.183Z","avatar_url":"https://github.com/remove-bg.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![RemoveBG](resources/removebgByCanva.svg)](https://www.remove.bg/)\n\n# remove.bg Ruby Gem\n\n\u003cp align=\"center\"\u003e\n\n[![Gem Version](https://img.shields.io/gem/v/remove_bg?style=for-the-badge\u0026logo=rubygems\u0026logoColor=aaa\u0026color=367cd3)](https://rubygems.org/gems/remove_bg)\n[![Gem Total Downloads](https://img.shields.io/gem/dt/remove_bg?style=for-the-badge\u0026logo=ruby\u0026logoColor=aaa\u0026color=367cd3)](https://rubygems.org/gems/remove_bg)\n[![CircleCI](https://img.shields.io/circleci/build/github/remove-bg/ruby?style=for-the-badge\u0026logo=circleci\u0026logoColor=aaa)](https://circleci.com/gh/remove-bg/ruby/tree/main)\n[![GitHub License](https://img.shields.io/github/license/remove-bg/ruby?style=for-the-badge\u0026logo=readthedocs\u0026logoColor=aaa)](https://github.com/remove-bg/ruby/blob/main/LICENSE.md)\n[![Codecov](https://img.shields.io/codecov/c/github/remove-bg/ruby?style=for-the-badge\u0026logo=codecov\u0026logoColor=aaa)](https://app.codecov.io/gh/remove-bg/ruby)\n[![Sonar Quality Gate](https://img.shields.io/sonar/quality_gate/remove-bg_ruby?server=https%3A%2F%2Fsonarcloud.io\u0026style=for-the-badge\u0026logo=sonarcloud\u0026logoColor=aaa)](https://sonarcloud.io/summary/overall?id=remove-bg_ruby)\n[![Violations](https://img.shields.io/sonar/violations/remove-bg_ruby?server=https%3A%2F%2Fsonarcloud.io\u0026format=short\u0026style=for-the-badge\u0026logo=sonarcloud\u0026logoColor=aaa)](https://sonarcloud.io/summary/overall?id=remove-bg_ruby)\n[![Dependencies](https://img.shields.io/depfu/dependencies/github/remove-bg%2Fruby?style=for-the-badge\u0026logo=dependabot\u0026logoColor=aaa)](https://github.com/remove-bg/ruby/network/dependencies)\n\n\u003c/p\u003e\n\n## Requirements\n\nThis gem is compatible with Ruby 3.2+ and can be used with\n[Faraday](https://rubygems.org/gems/faraday/) version 2 and above\n\nAn API key (free) from [remove.bg](https://www.remove.bg/api) is required.\n\n## Quickstart Installation\n\nAdd the gem to your `Gemfile` and run `bundle install`:\n\n```ruby\ngem \"remove_bg\"\n```\n\nOr run `gem install remove_bg` to install globally.\n\nPlease note the base configuration has the following resolution limits:\n\n| Output format | Resolution limit |\n|---------------|------------------|\n| PNG           | 10 megapixels    |\n| JPG           | 50 megapixels    |\n\n## Full installation\n\nFor best performance and quality the gem requires an image processing library.\nPlease install one of the following libraries:\n\n- [ImageMagick](https://www.imagemagick.org/)\n- [GraphicsMagick](http://www.graphicsmagick.org/)\n- [libvips](http://libvips.github.io/libvips/)\n\nThe gem will auto-detect any image processing libraries present. However, you can\nalso explicitly configure which library to use:\n\n```ruby\nRemoveBg.configure do |config|\n  config.image_processor = :minimagick # For ImageMagick or GraphicsMagick\n  # or\n  config.image_processor = :vips\nend\n```\n\nThe full installation has the following resolution limits:\n\n| Output format | Resolution limit |\n|---------------|------------------|\n| PNG           | 10 megapixels    |\n| JPG           | 50 megapixels    |\n| ZIP           | 50 megapixels    |\n\n# Usage\n\nFor more in-depth documentation please see [RubyDoc](https://www.rubydoc.info/gems/remove_bg)\n\n## Configuring an API key\n\nTo configure a global API key (used by default unless overridden per request):\n\n```ruby\nRemoveBg.configure do |config|\n  config.api_key = \"\u003capi-key\u003e\"\nend\n```\n\nIt's not recommended to commit your API key to version control. You may want to\nread the API key from an environment variable (e.g.\n`ENV.fetch(\"REMOVE_BG_API_KEY\")`) or find an alternative method.\n\n## Removing the background from an image\n\nCurrently the gem supports removing the background from a file or a URL:\n\n```ruby\nRemoveBg.from_file(\"image.png\")\nRemoveBg.from_url(\"http://example.com/image.png\")\n```\n\n## Request options\n\nThe processing options outlined in the [API reference](https://www.remove.bg/api)\ncan be specified per request:\n\n```ruby\nRemoveBg.from_file(\"image.png\", size: \"hd\", type: \"product\", channels: \"rgba\")\n```\n\nThe API key can also be specified per request:\n\n```ruby\nRemoveBg.from_file(\"image.png\", api_key: \"\u003capi-key\u003e\")\n```\n\n## Handling the result\n\nBackground removal requests return a result object which includes the processed\nimage data and the metadata about the operation.\n\n```ruby\nresult = RemoveBg.from_file(\"image.png\")\nresult.data             # =\u003e \"\\x89PNG...\"\nresult.height           # =\u003e 333\nresult.width            # =\u003e 500\nresult.credits_charged  # =\u003e 1.0\n```\n\nThere's also a `#save` convenience method:\n\n```ruby\nresult.save(\"processed/image.png\")\n# Overwrite any existing file\nresult.save!(\"processed/image.png\")\n```\n\n## Producing transparent images over 10 megapixels\n\nAfter configuring a full installation (detailed above) you can process images\nover 10 megapixels with a transparent output.\n\nProcess images with either the `png` or `zip` format. If you specify the `zip`\nformat it's possible to save the archive and handle composition yourself.\n\n```ruby\nresult = RemoveBg.from_file(\"large-image.jpg\", format: \"zip\")\n\nresult.save(\"result-with-transparency.png\")\n# or\nresult.save_zip(\"result.zip\") # If you want to handle composition yourself\n```\n\n## Rate limits\n\nThe [API has rate limits][rate-limits]. Image processing results include the\nrate limit information:\n\n```ruby\nresult = RemoveBg.from_file(\"image.jpg\")\nresult.rate_limit.to_s\n# =\u003e \u003cRateLimit reset_at='2020-05-20T12:00:00Z' total=500 remaining=499 retry_after_seconds=nil\u003e\n```\n\nIf you exceed the rate limit a `RemoveBg::RateLimitError` exception will be\nraised. This also contains further information via the `#rate_limit` method.\n\n[rate-limits]: https://www.remove.bg/api#rate-limit\n\n## Fetching account information\n\nTo display the [account information][account-info] for the currently configured\nAPI key:\n\n[account-info]: https://www.remove.bg/api#operations-tag-Fetch_account_info\n\n```ruby\naccount = RemoveBg.account_info # If an API key is set via RemoveBg.configuration\n# or\naccount = RemoveBg.account_info(api_key: \"\u003capi_key\u003e\")\n\naccount.api.free_calls # =\u003e 50\naccount.credits.total  # =\u003e 200\n```\n\n## Examples\n\n- [Bulk processing][bulk-processing] a directory of JPG and PNG files\n\n[bulk-processing]: https://github.com/remove-bg/ruby/blob/master/examples/bulk_process.rb\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at [remove-bg/ruby](https://github.com/remove-bg/ruby).\n\n## Development\n\n### Setup\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run\n`rake spec` to run the tests.\n\n### Releasing a new version\nTo release a new version, update the version number in `version.rb`, and then run\n`bundle exec rake release`, which will create a git tag for the version, push\ngit commits and tags, and push the `.gem` file to\n[rubygems.org](https://rubygems.org).\n\n### Documentation\n\nTo preview the [YARD documentation](https://yardoc.org/) locally run:\n\n```\nbundle exec yard server --reload\nopen http://localhost:8808/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremove-bg%2Fruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremove-bg%2Fruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremove-bg%2Fruby/lists"}