SDKs overview

ObjectCut provides Software Development Kits (SDKs) and client libraries to facilitate integration with its image processing APIs. These SDKs are designed to abstract the underlying HTTP requests, authentication, and response parsing, allowing developers to interact with ObjectCut services using familiar programming language constructs. The primary goal of these libraries is to streamline the development process for tasks such as background removal, image upscaling, and object detection within various application environments.

The SDKs are maintained by ObjectCut and are distributed through standard package managers for each respective language. They provide a programmatic interface for accessing core ObjectCut functionalities, including the background removal API, image upscaling API, and image segmentation API. Each SDK typically includes methods for initializing the client, making API calls, handling responses, and managing potential errors. Developers can consult the ObjectCut documentation for specific SDK usage instructions and API endpoint details.

Official SDKs by language

ObjectCut offers official SDKs for several popular programming languages, ensuring broad compatibility for developers. These SDKs are actively maintained and are the recommended method for interacting with the ObjectCut API. They encapsulate the complexity of direct API calls, offering type-safe and language-idiomatic ways to access the service's features. The following table provides an overview of the officially supported SDKs:

Language Package Name Installation Command Maturity
Python objectcut-python pip install objectcut-python Stable
Node.js @objectcut/node npm install @objectcut/node Stable
PHP objectcut/php-sdk composer require objectcut/php-sdk Stable
Java com.objectcut:java-sdk Add to pom.xml or build.gradle Stable
Ruby objectcut-ruby gem install objectcut-ruby Stable

Each SDK is designed to align with the conventions of its respective language, providing a consistent developer experience. For example, the Python SDK documentation details how to set up the client and make requests, while the Node.js SDK guide provides asynchronous examples suitable for JavaScript environments.

Installation

Installing an ObjectCut SDK typically involves using the standard package manager for your chosen programming language. The process is designed to be straightforward, allowing developers to quickly integrate the library into their projects.

Python

To install the Python SDK, use pip, the Python package installer. This command fetches the latest version of the objectcut-python package from PyPI:

pip install objectcut-python

After installation, you can import the library into your Python scripts. For more detailed instructions on setting up a Python development environment, refer to the official Python downloads page.

Node.js

For Node.js projects, the SDK is available via npm (Node Package Manager). Execute the following command in your project directory:

npm install @objectcut/node

This command adds the @objectcut/node package to your node_modules folder and updates your package.json file. Node.js applications can then import the module using require or import statements. The npm install documentation provides further details on package management.

PHP

The PHP SDK is distributed through Composer, the dependency manager for PHP. To install it, navigate to your project root and run:

composer require objectcut/php-sdk

This command will download the necessary files and update your composer.json and composer.lock files. Your PHP application can then autoload the SDK classes. The Composer installation guide can assist with initial Composer setup.

Java

For Java projects, the ObjectCut SDK can be included as a dependency using Maven or Gradle. Below are examples for each build system:

Maven

Add the following to your pom.xml file within the <dependencies> block:

<dependency>
    <groupId>com.objectcut</groupId>
    <artifactId>java-sdk</artifactId>
    <version>1.0.0</version> <!-- Replace with the latest version -->
</dependency>

Gradle

Add the following to your build.gradle file within the dependencies { ... } block:

implementation 'com.objectcut:java-sdk:1.0.0' // Replace with the latest version

Ensure you replace 1.0.0 with the latest version number from the ObjectCut Java SDK documentation. The Maven Getting Started Guide provides an introduction to Maven project setup.

Ruby

The Ruby SDK is available as a gem. To install it, use the gem command:

gem install objectcut-ruby

After installation, you can require the gem in your Ruby scripts. For more details on RubyGems and gem management, consult the RubyGems documentation.

Quickstart example

This example demonstrates how to use the ObjectCut Python SDK to remove the background from an image. Before running, ensure you have installed the Python SDK and replaced YOUR_API_KEY with your actual ObjectCut API key, which can be obtained from your ObjectCut account dashboard.

import objectcut

# Initialize the ObjectCut client with your API key
client = objectcut.Client(api_key="YOUR_API_KEY")

# Path to the input image file
input_image_path = "path/to/your/image.jpg"
# Path to save the output image with background removed
output_image_path = "path/to/save/output_image_no_bg.png"

try:
    # Perform background removal
    # The 'remove_background' method typically accepts a file path or image data
    # and returns the processed image data or saves it directly.
    result = client.image.remove_background(
        image_file=input_image_path,
        output_file=output_image_path,
        format="png" # Specify output format, e.g., png for transparency
    )

    if result.status_code == 200:
        print(f"Background removed successfully. Output saved to {output_image_path}")
    else:
        print(f"Error removing background: {result.error_message}")

except objectcut.ObjectCutError as e:
    print(f"An ObjectCut API error occurred: {e}")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

This snippet illustrates the basic flow: client initialization, specifying input and output paths, calling the background removal method, and handling potential responses or errors. Similar quickstart examples for other languages are available in the ObjectCut SDK documentation.

Community libraries

While ObjectCut provides official SDKs, the developer community may also contribute open-source libraries, wrappers, or plugins that extend or integrate with the ObjectCut API. These community-driven projects can offer additional functionalities, support for less common languages, or integrations with specific frameworks or platforms not covered by the official SDKs.

Community libraries are typically found on platforms like GitHub, GitLab, or language-specific package repositories. Developers interested in exploring these options should be aware that:

  • Maintenance: Community libraries may not be officially supported or maintained by ObjectCut. Their upkeep depends on the original authors and contributors.
  • Stability: The stability and API compatibility of community libraries can vary. It's advisable to check the project's activity, issue tracker, and release history.
  • Security: Always review the source code and dependencies of third-party libraries for security vulnerabilities before integrating them into production environments.

As of 2026, ObjectCut's primary focus is on its official SDKs. For the most up-to-date list of community contributions or to find out how to contribute your own, developers can refer to the ObjectCut community resources page or search relevant open-source repositories. Resources like Google's Open Source Community Guidelines offer a general framework for evaluating community projects.