Detect Background Type
Extracts the background_type whether it's perfectly plain, subtly textured, or notably busy with objects and background_color hex code which is the most dominant colour from the image's background.
This transformation supports png
, jpeg
, jpg
, webp
, cr2
, nef
, rw2
, dng
, orf
, raw
, heic
, heif
, avif
, tiff
and tif
type of files.
Output
Output Format: A JSON containing predicted metadata from the product image containing a string output for background_type
. The outputs can be plain
, clean
and busy
. The background_color
output consists the hex code for the most dominant colour of the image's background.
- Original Image
- Context API Response
- URL
- React
- JavaScript
- Node.js
- Python
- Golang
- Kotlin
- C#
- PHP
<PixelBinImage
url="https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg"
/>
import Pixelbin from "@pixelbin/core";
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [],
filePath: "images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg",
baseUrl: "https://cdn.pixelbin.io",
};
const url = Pixelbin.default.utils.objToUrl(obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg
const Pixelbin = require("@pixelbin/admin");
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [],
filePath: "images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg",
baseUrl: "https://cdn.pixelbin.io",
};
const url = Pixelbin.url.objToUrl(obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg
from pixelbin.utils.url import obj_to_url
obj = {
"cloudName": "dummy-cloudname",
"zone": "FIDrmb",
"version": "v2",
"transformations": [],
"filePath": "images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg",
"baseUrl": "https://cdn.pixelbin.io",
}
url = obj_to_url(obj)
# url
# https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg
package main
import (
"fmt"
"github.com/pixelbin-dev/pixelbin-go/v2/sdk/utils/url"
)
func main() {
obj := map[string]interface{}{
"cloudName": "dummy-cloudname",
"zoneSlug": "FIDrmb",
"version": "v2",
"transformations": []map[string]interface{}{
},
"filePath": "images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg",
"baseUrl": "https://cdn.pixelbin.io",
"options": map[string]interface{}{},
}
urlstring, err := url.ObjToUrl(obj)
if err != nil {
fmt.Println(err)
}
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg
import com.pixelbin.url.UrlObj
import com.pixelbin.Utils
import com.pixelbin.transformation.TransformationObj
fun main(){
val obj = UrlObj(
cloudName = "dummy-cloudname",
zone = "FIDrmb",
version = "v2",
transformation = arrayListOf(
),
filePath = "images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg",
baseUrl = "https://cdn.pixelbin.io"
)
val url = Utils.objToUrl(obj)
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg
using System;
using System.Collections.Generic;
using System.IO;
using Pixelbin.Utils;
namespace ExampleNamespace
{
class ExampleClass
{
static void Main(string[] args)
{
UrlObj obj = new UrlObj(
version: "v2",
cloudName: "dummy-cloudname",
filePath: "images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg",
zone: "FIDrmb",
baseUrl: "https://cdn.pixelbin.io",
transformations: new List<UrlTransformation>() {
}
);
string url = Url.ObjToUrl(obj);
}
}
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg
<?php
require 'vendor/autoload.php';
use Pixelbin\Utils\Url;
$obj = [
"cloudName" => "dummy-cloudname",
"zone" => "FIDrmb",
"version" => "v2",
"options" => [],
"transformations" => [
],
"filePath" => "images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg",
"baseUrl" => "https://cdn.pixelbin.io",
];
$url = Url::obj_to_url($obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/Rangita-Mauve-Banarasi-Silk-Saree-SDL541248343-1-ddf13-TqEV0_NXL.jpeg
?>
{
"output": {
"backgrond_color": "#e1cdad",
"background_type": "clean"
}
}