Pixelbin kotlin library helps you integrate Pixelbin with your Android Application.
Add the dependency
// gradle
dependencies {
//for latest version
implementation 'io.pixelbin:pixelbin-kotlin-sdk:version'
//for below 0.0.10 version
implementation 'io.github.pixelbin-dev:pixelbin-kotlin-sdk:version'
}
For other artifacts check this link pixelbin-kotlin-sdk
- Import the Pixelbin class
import io.pixelbin.sdk_kotlin.*
- Create your instance
val pixelbin = PixelBin.getInstance()
val image = pixelbin.url("https://cdn.pixelbin.io/v2/dummy-cloudname/original/__playground/playground-default.jpeg")
val image = pixelbin.url(
UrlObj(
baseUrl = baseUrl,
version = version,
cloudName = cloudName,
zone = zone,
transformation = transformationList,
filePath = imagePath
)
)
Import transformations
import io.pixelbin.sdk_kotlin.transformation.Transformation
val eraseTransformation = Transformation.erasebg();
// Create a new instance. If you have't (see above for the details)
val pixelbin = PixelBin.getInstance()
val image = pixelbin.url(imageUrl)
// Create EraseBg.bg transformation
// Kotlin
val t1 = Transformation.erasebg();
//Java
TransformationObj t1 = Transformation.INSTANCE.erasebg();
// Create resize transformation
// Kotlin
val t2 = Transformation.tResize(height = 100,width = 100)
//Java
TransformationObj t2 = Transformation.INSTANCE.tResize(height = 100,width = 100);
// Add the transformations to the image object
//add single transformation
image.addTransformation(t1);
//or add multiple transformation
//Kotlin
image.addTransformation(arrayListOf(t1,t2));
//Java
ArrayList<TransformationObj> list = new ArrayList<>();
list.add(t1);
list.add(t2);
image.add(list);
// Get the image url
image.getUrl()
// output
// https://cdn.pixelbin.io/v2/cloudName/z-slug/erase.bg()~t.resize(h:100,w:100)/path/to/image.jpeg
| parameter | type |
|---|---|
| file (File) | File to upload to Pixelbin |
| signedDetails (Object) | signedDetails can be generated with the Pixelbin Backend SDK @pixelbin/admin. |
| chunkSize (int) | size of chunks to be uploaded in kb. default value is 1024. |
| Recommended chunk size for | |
| 3g network - upto 5kb | |
| 4g network - 500kb to 1MB | |
| 5g network - 1MB to 2MB | |
| concurrency (int) | number of chunks to be uploaded in parallel api calls |
- Resolves with no response on success.
- Rejects with error on failure. Example :
- Define a file element
val file = File(pathname);
- Use the presignedUrl generated with the backend sdk. click here.
val signedDetails = SignedDetails(url = "url", fields = fieldsToHashMap(fields))
//fields refer to hashmap of fields object which we got from signed url api
Example
data class Fields(
@SerializedName("x-goog-meta-assetdata") var xGoogMetaAssetData: String? = null,
@SerializedName("x-goog-meta-token") var xGoogMetaToken: String? = null,
@SerializedName("Access-Control-Request-Headers") var headers: String? = null,
@SerializedName("Content-Type") var contentType: String? = null,
//for pixelbin host
@SerializedName("x-pixb-meta-assetdata") var xPixbMetaAssetdata: String? = null
)
fun fieldsToHashMap(fields: Fields): HashMap<String, String> {
val hashMap = HashMap<String, String>()
hashMap["x-goog-meta-assetData"] = fields.xGoogMetaAssetData?:""
hashMap["x-goog-meta-token"] = fields.xGoogMetaToken?:""
hashMap["Access-Control-Request-Headers"] = fields.headers?:""
hashMap["Content-Type"] = fields.contentType?:""
//for pixelbin host
hashMap["x-pixb-meta-assetdata"] = fields.xPixbMetaAssetdata?:""
return hashMap
}
//for kotlin
CoroutineScope(Dispatchers.IO).launch {
PixelBin.getInstance().upload(file, details, {
when (it) {
is com.pixelbin.upload.Result.Success -> {
val response = it.data
}
is com.pixelbin.upload.Result.Failure -> {
val response = it.response
}
is com.pixelbin.upload.Result.Error -> {
val exception = it.exception
}
else -> {}
}
}, chunkSize, concurrency)
}
//for java
pixelbin.upload(file,signedDetails, result->{
//here Result class is from com.pixelbin.upload.Result
if (result instanceof Result.Success) {
System.out.println("Upload successful");
} else if (result instanceof Result.Failure) {
Result.Failure failure = (Result.Failure) result;
System.out.println("Upload failed: " + failure.getResponse());
} else if (result instanceof Result.Error) {
Result.Error error = (Result.Error) result;
System.out.println("Error during upload: " + error.getException().getMessage());
}
return null;
},chunkSize, concurrency);
Import the utils class
import io.pixelbin.sdk_kotlin.Utils
Pixelbin provides url utilities to construct and deconstruct Pixelbin urls.
Deconstruct a pixelbin url
| parameter | description | example |
|---|---|---|
| pixelbinUrl (string) | A valid pixelbin url | https://cdn.pixelbin.io/v2/your-cloud-name/z-slug/t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg |
| isCustomDomain (boolean) | Indicates if the URL belongs to a custom domain (default) | false |
| Returns: | ||
| property | description | example |
| -------------------------- | ----------------------------------------------------------- | -------------------------------------- |
| cloudName (string) | The cloudname extracted from the url | your-cloud-name |
| zone (string) | 6 character zone slug | z-slug |
| version (string) | cdn api version | v2 |
| transformations (array) | Extracted transformations from the url | |
| filePath | Path to the file on Pixelbin storage | /path/to/image.jpeg |
| baseUrl (string) | Base url | https://cdn.pixelbin.io/ |
| worker (boolean) | Indicates if the URL is a URL Translation Worker URL | false |
| workerPath (string) | Input path to a URL Translation Worker | resize:w200,h400/folder/image.jpeg |
| options (Object) | Query parameters added, such as "dpr" and "f_auto" | { dpr: 2.5, f_auto: true} |
| isCustomDomain (boolean) | Indicates if the URL belongs to a custom domain (default) | false |
| Example: |
val pixelbinUrl =
"https://cdn.pixelbin.io/v2/your-cloud-name/z-slug/t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg";
//string representation of url object
//name of transformation = plugin+"."+name
val obj = Utils.urlToUrlObj(pixelbinUrl)
// UrlObj(
// baseUrl = "https://cdn.pixelbin.io/",
// version = "v2",
// cloudName = "your-cloud-name",
// transformation= arrayListOf(
// TransformationObj(
// plugin = "t",
// name = "resize",
// values= hashMapOf(
// "w" to "200",
// "h" to "100",
// )
// ),
// TransformationObj(
// plugin = "t",
// name = "flip",
// )
// ),
// zone =" z-slug",
// filePath = "path/to/image.jpeg",
// wrkr = false;
// workerPath = ";
// )
val pixelbinUrl =
"https://xyz.designify.media/v2/your-cloud-name/z-slug/t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg";
val obj = Utils.urlToUrlObj(url=pixelbinUrl, isCustomDomain = true)
// UrlObj(
// baseUrl = "https://cdn.pixelbin.io/",
// version = "v2",
// cloudName = "your-cloud-name",
// transformation= arrayListOf(
// TransformationObj(
// plugin = "t",
// name = "resize",
// values= hashMapOf(
// "w" to "200",
// "h" to "100",
// )
// ),
// TransformationObj(
// plugin = "t",
// name = "flip",
// )
// ),
// zone =" z-slug",
// filePath = "path/to/image.jpeg",
// isCustomDomain = true
// wrkr = false;
// workerPath = ";
// )
val pixelbinUrl =
"https://cdn.pixelbin.io/v2/your-cloud-name/z-slug/t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg?dpr=2.0&f_auto=True";
//string representation of url object
//name of transformation = plugin+"."+name
val obj = Utils.urlToUrlObj(pixelbinUrl)
// UrlObj(
// baseUrl = "https://cdn.pixelbin.io/",
// version = "v2",
// cloudName = "your-cloud-name",
// transformation = arrayListOf(
// TransformationObj(
// plugin = "t",
// name = "resize",
// values= hashMapOf(
// "w" to "200",
// "h" to "100",
// )
// ),
// TransformationObj(
// plugin="t",
// name="flip",
// )
// ),
// zone = "z-slug",
// options = hashMapOf(
// "dpr" to "2.0",
// "f_auto" to "true"
// ),
// filePath = "path/to/image.jpeg",
// wrkr = false;
// workerPath = ";
// )
val pixelbinUrl =
"https://cdn.pixelbin.io/v2/your-cloud-name/z-slug/wrkr/t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg?dpr=2.0&f_auto=True";
//string representation of url object
//name of transformation = plugin+"."+name
val obj = Utils.urlToUrlObj(pixelbinUrl)
// UrlObj(
// baseUrl = "https://cdn.pixelbin.io/",
// version = "v2",
// cloudName = "your-cloud-name",
// transformation = arrayListOf<TransformationObj>(),
// zone = "z-slug",
// options = hashMapOf(
// "dpr" to "2.0",
// "f_auto" to "true"
// ),
// filePath = "",
// wrkr = true;
// workerPath = "t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg";
// )
Converts the extracted url obj to a Pixelbin url.
| property | description | example |
|---|---|---|
| cloudName (string) | The cloudname extracted from the url | your-cloud-name |
| zone (string) | 6 character zone slug | z-slug |
| version (string) | cdn api version | v2 |
| transformations (array) | Extracted transformations from the url | |
| filePath | Path to the file on Pixelbin storage | /path/to/image.jpeg |
| baseUrl (string) | Base url | https://cdn.pixelbin.io/ |
| worker (boolean) | Indicates if the URL is a URL Translation Worker URL | false |
| workerPath (string) | Input path to a URL Translation Worker | resize:w200,h400/folder/image.jpeg |
| options (Object) | Query parameters added, such as "dpr" and "f_auto" | { dpr: 2.5, f_auto: true} |
| isCustomDomain (boolean) | Indicates if the URL belongs to a custom domain (default) | false |
| Example |
val obj = UrlObj(
cloudName = "your-cloud-name",
zone = "z-slug",
version = "v2",
transformation = arrayListOf(
TransformationObj(
plugin = "t",
name = "resize",
values= hashMapOf(
"w" to "200",
"h" to "100",
)
),
TransformationObj(
plugin = "t",
name = "flip",
)
),
filePath = "path/to/image.jpeg",
baseUrl = "https://cdn.pixelbin.io"
)
val url = Utils.objToUrl(pixelbinUrl) // obj is as shown above
// url
// https://cdn.pixelbin.io/v2/your-cloud-name/z-slug/t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg
val obj = UrlObj(
cloudName = "your-cloud-name",
zone = "z-slug",
version = "v2",
transformation = arrayListOf(
TransformationObj(
plugin = "t",
name = "resize",
values= hashMapOf(
"w" to "200",
"h" to "100",
)
),
TransformationObj(
plugin = "t",
name = "flip()",
)
),
filePath = "path/to/image.jpeg",
baseUrl = "https://cdn.pixelbin.io",
options = hashMapOf(
"dpr" to "2.0",
"f_auto" to "true"
)
)
val url = Utils.objToUrl(obj) // obj is as shown above
// url
// https://cdn.pixelbin.io/v2/your-cloud-name/z-slug/t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg?dpr=2.0&f_auto=True
val obj = UrlObj(
baseUrl = "https://cdn.pixelbin.io/",
version = "v2",
cloudName = "your-cloud-name",
transformation = arrayListOf<TransformationObj>(),
zone = "z-slug",
options = hashMapOf(
"dpr" to "2.0",
"f_auto" to "true"
),
filePath = "",
wrkr = true;
workerPath = "t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg";
)
val url = Utils.objToUrl(obj)
//url
//"https://cdn.pixelbin.io/v2/your-cloud-name/z-slug/wrkr/t.resize(h:100,w:200)~t.flip()/path/to/image.jpeg?dpr=2.0&f_auto=True";
Classifies the background of a product as plain, clean or busy
val t = Transformation.dbtDetect(
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| height | integer | 0 |
| width | integer | 0 |
| fit | enum: cover, contain, fill, inside, outside |
TResize.Fit.COVER |
| background | color | "000000" |
| position | enum: top, bottom, left, right, right_top, right_bottom, left_top, left_bottom, center |
TResize.Position.CENTER |
| algorithm | enum: nearest, cubic, mitchell, lanczos2, lanczos3 |
TResize.Algorithm.LANCZOS3 |
| dpr | float | 1 |
val t = Transformation.tResize(
height = 0,
width = 0,
fit = TResize.Fit.COVER,
background = "000000",
position = TResize.Position.CENTER,
algorithm = TResize.Algorithm.LANCZOS3,
dpr = 1
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| quality | integer | 80 |
val t = Transformation.tCompress(
quality = 80
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| top | integer | 10 |
| left | integer | 10 |
| bottom | integer | 10 |
| right | integer | 10 |
| background | color | "000000" |
| borderType | enum: constant, replicate, reflect, wrap |
TExtend.Bordertype.CONSTANT |
| dpr | float | 1 |
val t = Transformation.tExtend(
top = 10,
left = 10,
bottom = 10,
right = 10,
background = "000000",
bordertype = TExtend.Bordertype.CONSTANT,
dpr = 1
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| top | integer | 10 |
| left | integer | 10 |
| height | integer | 50 |
| width | integer | 20 |
| boundingBox | bbox | null |
val t = Transformation.tExtract(
top = 10,
left = 10,
height = 50,
width = 20,
boundingbox = null
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| threshold | integer | 10 |
val t = Transformation.tTrim(
threshold = 10
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| angle | integer | 0 |
| background | color | "000000" |
val t = Transformation.tRotate(
angle = 0,
background = "000000"
)Basic Transformations
val t = Transformation.tFlip(
)Basic Transformations
val t = Transformation.tFlop(
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| sigma | float | 1.5 |
val t = Transformation.tSharpen(
sigma = 1.5
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| size | integer | 3 |
val t = Transformation.tMedian(
size = 3
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| sigma | float | 0.3 |
| dpr | float | 1 |
val t = Transformation.tBlur(
sigma = 0.3,
dpr = 1
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| background | color | "000000" |
val t = Transformation.tFlatten(
background = "000000"
)Basic Transformations
val t = Transformation.tNegate(
)Basic Transformations
val t = Transformation.tNormalise(
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| a | integer | 1 |
| b | integer | 0 |
val t = Transformation.tLinear(
a = 1,
b = 0
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| brightness | float | 1 |
| saturation | float | 1 |
| hue | integer | 90 |
val t = Transformation.tModulate(
brightness = 1,
saturation = 1,
hue = 90
)Basic Transformations
val t = Transformation.tGrey(
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| color | color | "000000" |
val t = Transformation.tTint(
color = "000000"
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| format | enum: jpeg, png, webp, tiff, avif, bmp, heif |
TToformat.Format.JPEG |
| quality | enum: 100, 95, 90, 85, 80, 75, 70, 60, 50, 40, 30, 20, 10, best, good, eco, low |
TToformat.Quality._75 |
val t = Transformation.tToformat(
format = TToformat.Format.JPEG,
quality = TToformat.Quality._75
)Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| density | integer | 300 |
val t = Transformation.tDensity(
density = 300
)21. tMerge(mode, image, transformation, background, height, width, top, left, gravity, blend, tile, listOfBboxes, listOfPolygons)
Basic Transformations
| Parameter | Type | Default |
|---|---|---|
| mode | enum: overlay, underlay, wrap |
TMerge.Mode.OVERLAY |
| image | file | "" |
| transformation | custom | "" |
| background | color | "00000000" |
| height | integer | 0 |
| width | integer | 0 |
| top | integer | 0 |
| left | integer | 0 |
| gravity | enum: northwest, north, northeast, east, center, west, southwest, south, southeast, custom |
TMerge.Gravity.CENTER |
| blend | enum: over, in, out, atop, dest, dest-over, dest-in, dest-out, dest-atop, xor, add, saturate, multiply, screen, overlay, darken, lighten, colour-dodge, color-dodge, colour-burn, color-burn, hard-light, soft-light, difference, exclusion |
TMerge.Blend.OVER |
| tile | boolean | false |
| listOfBboxes | bboxList | null |
| listOfPolygons | polygonList | null |
val t = Transformation.tMerge(
mode = TMerge.Mode.OVERLAY,
image = "",
transformation = "",
background = "00000000",
height = 0,
width = 0,
top = 0,
left = 0,
gravity = TMerge.Gravity.CENTER,
blend = TMerge.Blend.OVER,
tile = false,
listofbboxes = null,
listofpolygons = null
)Artifact Removal Plugin
val t = Transformation.afRemove(
)Detect objects and text in images
| Parameter | Type | Default |
|---|---|---|
| maximumLabels | integer | 5 |
| minimumConfidence | integer | 55 |
val t = Transformation.awsrekDetectlabels(
maximumlabels = 5,
minimumconfidence = 55
)Detect objects and text in images
| Parameter | Type | Default |
|---|---|---|
| minimumConfidence | integer | 55 |
val t = Transformation.awsrekModeration(
minimumconfidence = 55
)AI Background Generator
| Parameter | Type | Default |
|---|---|---|
| backgroundPrompt | custom | "YSBmb3Jlc3QgZnVsbCBvZiBvYWsgdHJlZXMsd2l0aCBicmlnaHQgbGlnaHRzLCBzdW4gYW5kIGEgbG90IG9mIG1hZ2ljLCB1bHRyYSByZWFsaXN0aWMsIDhr" |
| focus | enum: Product, Background |
GenerateBg.Focus.PRODUCT |
| negativePrompt | custom | "" |
| seed | integer | 123 |
val t = Transformation.generateBg(
backgroundprompt = "YSBmb3Jlc3QgZnVsbCBvZiBvYWsgdHJlZXMsd2l0aCBicmlnaHQgbGlnaHRzLCBzdW4gYW5kIGEgbG90IG9mIG1hZ2ljLCB1bHRyYSByZWFsaXN0aWMsIDhr",
focus = GenerateBg.Focus.PRODUCT,
negativeprompt = "",
seed = 123
)1. bgExtend(boundingBox, prompt, negativePrompt, strength, guidanceScale, numberOfInferenceSteps, colorAdjust, seed)
AI Image Extender
| Parameter | Type | Default |
|---|---|---|
| boundingBox | bbox | null |
| prompt | custom | "" |
| negativePrompt | custom | "" |
| strength | float | 0.999 |
| guidanceScale | integer | 8 |
| numberOfInferenceSteps | integer | 10 |
| colorAdjust | boolean | false |
| seed | integer | 123 |
val t = Transformation.bgExtend(
boundingbox = null,
prompt = "",
negativeprompt = "",
strength = 0.999,
guidancescale = 8,
numberofinferencesteps = 10,
coloradjust = false,
seed = 123
)AI Variation Generator
| Parameter | Type | Default |
|---|---|---|
| generateVariationPrompt | custom | "" |
| noOfVariations | integer | 1 |
| seed | integer | 0 |
| autoscale | boolean | true |
val t = Transformation.vgGenerate(
generatevariationprompt = "",
noofvariations = 1,
seed = 0,
autoscale = true
)EraseBG Background Removal Module
| Parameter | Type | Default |
|---|---|---|
| industryType | enum: general, ecommerce, car, human, object |
EraseBg.Industrytype.GENERAL |
| addShadow | boolean | false |
| refine | boolean | true |
val t = Transformation.eraseBg(
industrytype = EraseBg.Industrytype.GENERAL,
addshadow = false,
refine = true
)Detect content and text in images
| Parameter | Type | Default |
|---|---|---|
| maximumLabels | integer | 5 |
val t = Transformation.googlevisDetectlabels(
maximumlabels = 5
)Image Centering Module
| Parameter | Type | Default |
|---|---|---|
| distancePercentage | integer | 10 |
val t = Transformation.imcDetect(
distancepercentage = 10
)1. icCrop(requiredWidth, requiredHeight, paddingPercentage, maintainOriginalAspect, aspectRatio, gravityTowards, preferredDirection, objectType)
Intelligent Crop Plugin
| Parameter | Type | Default |
|---|---|---|
| requiredWidth | integer | 0 |
| requiredHeight | integer | 0 |
| paddingPercentage | integer | 0 |
| maintainOriginalAspect | boolean | false |
| aspectRatio | string | "" |
| gravityTowards | enum: object, foreground, face, none |
IcCrop.Gravitytowards.NONE |
| preferredDirection | enum: north_west, north, north_east, west, center, east, south_west, south, south_east |
IcCrop.Preferreddirection.CENTER |
| objectType | enum: airplane, apple, backpack, banana, baseball_bat, baseball_glove, bear, bed, bench, bicycle, bird, boat, book, bottle, bowl, broccoli, bus, cake, car, carrot, cat, cell_phone, chair, clock, couch, cow, cup, dining_table, dog, donut, elephant, fire_hydrant, fork, frisbee, giraffe, hair_drier, handbag, horse, hot_dog, keyboard, kite, knife, laptop, microwave, motorcycle, mouse, orange, oven, parking_meter, person, pizza, potted_plant, refrigerator, remote, sandwich, scissors, sheep, sink, skateboard, skis, snowboard, spoon, sports_ball, stop_sign, suitcase, surfboard, teddy_bear, tennis_racket, tie, toaster, toilet, toothbrush, traffic_light, train, truck, tv, umbrella, vase, wine_glass, zebra |
IcCrop.Objecttype.PERSON |
val t = Transformation.icCrop(
requiredwidth = 0,
requiredheight = 0,
paddingpercentage = 0,
maintainoriginalaspect = false,
aspectratio = "",
gravitytowards = IcCrop.Gravitytowards.NONE,
preferreddirection = IcCrop.Preferreddirection.CENTER,
objecttype = IcCrop.Objecttype.PERSON
)Intelligent Masking
| Parameter | Type | Default |
|---|---|---|
| replacementImage | file | "" |
| detector | enum: face, text, number_plate |
ImMask.Detector.NUMBER_PLATE |
| maskType | enum: fill_black, pixelate, blur |
ImMask.Masktype.FILL_BLACK |
val t = Transformation.imMask(
replacementimage = "",
detector = ImMask.Detector.NUMBER_PLATE,
masktype = ImMask.Masktype.FILL_BLACK
)Classifies whether objects in the image are single or multiple
val t = Transformation.ocDetect(
)Detect NSFW content in images
| Parameter | Type | Default |
|---|---|---|
| minimumConfidence | float | 0.5 |
val t = Transformation.nsfwDetect(
minimumconfidence = 0.5
)Number Plate Detection Plugin
val t = Transformation.numplateDetect(
)Detect bounding boxes of objects in the image
val t = Transformation.odDetect(
)Calculates the percentage of the main object area relative to image dimensions.
| Parameter | Type | Default |
|---|---|---|
| objectThresholdPercent | integer | 50 |
val t = Transformation.cosDetect(
objectthresholdpercent = 50
)OCR Module
| Parameter | Type | Default |
|---|---|---|
| detectOnly | boolean | false |
val t = Transformation.ocrExtract(
detectonly = false
)PDF Watermark Removal Plugin
val t = Transformation.pwrRemove(
)AI Product Tagging
val t = Transformation.prTag(
)Classifies whether the product in the image is completely visible or not
val t = Transformation.cpvDetect(
)1. qrGenerate(width, height, image, margin, qRTypeNumber, qrErrorCorrectionLevel, imageSize, imageMargin, dotsColor, dotsType, dotsBgColor, cornerSquareColor, cornerSquareType, cornerDotsColor, cornerDotsType)
QRCode Plugin
| Parameter | Type | Default |
|---|---|---|
| width | integer | 300 |
| height | integer | 300 |
| image | custom | "" |
| margin | integer | 0 |
| qRTypeNumber | integer | 0 |
| qrErrorCorrectionLevel | enum: L, M, Q, H |
QrGenerate.Qrerrorcorrectionlevel.Q |
| imageSize | float | 0.4 |
| imageMargin | integer | 0 |
| dotsColor | color | "000000" |
| dotsType | enum: rounded, dots, classy, classy-rounded, square, extra-rounded |
QrGenerate.Dotstype.SQUARE |
| dotsBgColor | color | "ffffff" |
| cornerSquareColor | color | "000000" |
| cornerSquareType | enum: dot, square, extra-rounded |
QrGenerate.Cornersquaretype.SQUARE |
| cornerDotsColor | color | "000000" |
| cornerDotsType | enum: dot, square |
QrGenerate.Cornerdotstype.DOT |
val t = Transformation.qrGenerate(
width = 300,
height = 300,
image = "",
margin = 0,
qrtypenumber = 0,
qrerrorcorrectionlevel = QrGenerate.Qrerrorcorrectionlevel.Q,
imagesize = 0.4,
imagemargin = 0,
dotscolor = "000000",
dotstype = QrGenerate.Dotstype.SQUARE,
dotsbgcolor = "ffffff",
cornersquarecolor = "000000",
cornersquaretype = QrGenerate.Cornersquaretype.SQUARE,
cornerdotscolor = "000000",
cornerdotstype = QrGenerate.Cornerdotstype.DOT
)QRCode Plugin
val t = Transformation.qrScan(
)Remove background from any image
val t = Transformation.removeBg(
)AI Soft Shadow Generator
| Parameter | Type | Default |
|---|---|---|
| backgroundImage | file | null |
| backgroundColor | color | "ffffff" |
| shadowAngle | float | 120 |
| shadowIntensity | float | 0.5 |
val t = Transformation.shadowGen(
backgroundimage = null,
backgroundcolor = "ffffff",
shadowangle = 120,
shadowintensity = 0.5
)Super Resolution Module
| Parameter | Type | Default |
|---|---|---|
| type | enum: 2x, 4x, 8x |
SrUpscale.Type._2X |
| enhanceFace | boolean | false |
| model | enum: Picasso, Flash |
SrUpscale.Model.PICASSO |
| enhanceQuality | boolean | false |
val t = Transformation.srUpscale(
type = SrUpscale.Type._2X,
enhanceface = false,
model = SrUpscale.Model.PICASSO,
enhancequality = false
)Vertex AI based transformations
| Parameter | Type | Default |
|---|---|---|
| backgroundPrompt | custom | "YSBmb3Jlc3QgZnVsbCBvZiBvYWsgdHJlZXMsd2l0aCBicmlnaHQgbGlnaHRzLCBzdW4gYW5kIGEgbG90IG9mIG1hZ2ljLCB1bHRyYSByZWFsaXN0aWMsIDhr" |
| negativePrompt | custom | "" |
| seed | integer | 22 |
| guidanceScale | integer | 60 |
val t = Transformation.vertexaiGeneratebg(
backgroundprompt = "YSBmb3Jlc3QgZnVsbCBvZiBvYWsgdHJlZXMsd2l0aCBicmlnaHQgbGlnaHRzLCBzdW4gYW5kIGEgbG90IG9mIG1hZ2ljLCB1bHRyYSByZWFsaXN0aWMsIDhr",
negativeprompt = "",
seed = 22,
guidancescale = 60
)Vertex AI based transformations
val t = Transformation.vertexaiRemovebg(
)Vertex AI based transformations
| Parameter | Type | Default |
|---|---|---|
| type | enum: x2, x4 |
VertexaiUpscale.Type.X2 |
val t = Transformation.vertexaiUpscale(
type = VertexaiUpscale.Type.X2
)Video Watermark Removal Plugin
val t = Transformation.wmvRemove(
)Video Upscaler Plugin
val t = Transformation.vsrUpscale(
)Classifies wear type and view type of products in the image
val t = Transformation.vdDetect(
)Watermark Removal Plugin
| Parameter | Type | Default |
|---|---|---|
| removeText | boolean | false |
| removeLogo | boolean | false |
| box1 | string | "0_0_100_100" |
| box2 | string | "0_0_0_0" |
| box3 | string | "0_0_0_0" |
| box4 | string | "0_0_0_0" |
| box5 | string | "0_0_0_0" |
val t = Transformation.wmRemove(
removetext = false,
removelogo = false,
box1 = "0_0_100_100",
box2 = "0_0_0_0",
box3 = "0_0_0_0",
box4 = "0_0_0_0",
box5 = "0_0_0_0"
)Watermark Detection Plugin
| Parameter | Type | Default |
|---|---|---|
| detectText | boolean | false |
val t = Transformation.wmcDetect(
detecttext = false
)