Merge two images
Merge transformation allows users to add layers and merge images. The user can overlay, underlay or wrap and merge the images as per the user’s requirements. The user can also add a background color instead of an image. The parameters will help to control how the second image is positioned on your base image, and how they blend.
The user can use this transformation to add logos, watermarks and signatures and more to your images. This can also be used to hide or censor parts of your images. Merging two images also helps you to combine two or more images into a single image.
Params
Mode (m
)
Sets the order of merging.
Valid values are overlay
, underlay
and wrap
. The overlay
is the default value.
Underlay is an image that is added under a semi-transparent base image and overlay is an image that is added to the top of your image.
Both overlay and wrap will lay one image over another, but overlay can only work with a single rectangular box, while wrap can be used with multiple rectangular boxes or polygons.
Image (i
)
Unique Id of the composite image.
Select an image you want to add to your base image from the Playground of PixelBin.
Background (bg
)
The background color is to be merged with the base image.
Instead of merging with another image, you can merge your base image with a background color.
Height (h
), Width (w
)
This option is only available when you are adding a background. This option will help you to adjust the size of the background.
These parameters will only work for underlay and overlay modes.
Top (t
), Left (l
)
This option is only available when you are adding a background. This option will help you to adjust the size of the background.
These parameters will only work for underlay and overlay modes.
Gravity (g
)
Specifies the position of the overlay image.
Valid values are northwest
, north
, northeast
, east
, center
, west
, southwest
, south
, southeast
and custom
. The default is center
.
This parameter will only work for underlay and overlay modes.
- Original Image
- gravity=southwest
- gravity=custom, top=200, left=125
- URL
- React
- JavaScript
- Node.js
- Python
- Golang
- Kotlin
- C#
- PHP
<PixelBinImage
url="https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/basic_pink_flower.jpeg"
/>
import Pixelbin from "@pixelbin/core";
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [],
filePath: "images/transformation/basic_pink_flower.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/basic_pink_flower.jpeg
const Pixelbin = require("@pixelbin/admin");
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [],
filePath: "images/transformation/basic_pink_flower.jpeg",
baseUrl: "https://cdn.pixelbin.io",
};
const url = Pixelbin.url.objToUrl(obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/basic_pink_flower.jpeg
from pixelbin.utils.url import obj_to_url
obj = {
"cloudName": "dummy-cloudname",
"zone": "FIDrmb",
"version": "v2",
"transformations": [],
"filePath": "images/transformation/basic_pink_flower.jpeg",
"baseUrl": "https://cdn.pixelbin.io",
}
url = obj_to_url(obj)
# url
# https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/basic_pink_flower.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/basic_pink_flower.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/basic_pink_flower.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/basic_pink_flower.jpeg",
baseUrl = "https://cdn.pixelbin.io"
)
val url = Utils.objToUrl(obj)
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/basic_pink_flower.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/basic_pink_flower.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/basic_pink_flower.jpeg
<?php
require 'vendor/autoload.php';
use Pixelbin\Utils\Url;
$obj = [
"cloudName" => "dummy-cloudname",
"zone" => "FIDrmb",
"version" => "v2",
"options" => [],
"transformations" => [
],
"filePath" => "images/transformation/basic_pink_flower.jpeg",
"baseUrl" => "https://cdn.pixelbin.io",
];
$url = Url::obj_to_url($obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/basic_pink_flower.jpeg
?>
- URL
- React
- JavaScript
- Node.js
- Python
- Golang
- Kotlin
- C#
- PHP
<PixelBinImage
url="https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:southwest)/images/transformation/basic_pink_flower.jpeg"
/>
import Pixelbin from "@pixelbin/core";
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [{"name":"merge","plugin":"t","values":[{"key":"i","value":"X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key":"tr","value":"dC5yZXNpemUoaDoyMDAsdzoyMDAp"},{"key":"g","value":"southwest"}]}],
filePath: "images/transformation/basic_pink_flower.jpeg",
baseUrl: "https://cdn.pixelbin.io",
};
const url = Pixelbin.default.utils.objToUrl(obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:southwest)/images/transformation/basic_pink_flower.jpeg
const Pixelbin = require("@pixelbin/admin");
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [{"name":"merge","plugin":"t","values":[{"key":"i","value":"X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key":"tr","value":"dC5yZXNpemUoaDoyMDAsdzoyMDAp"},{"key":"g","value":"southwest"}]}],
filePath: "images/transformation/basic_pink_flower.jpeg",
baseUrl: "https://cdn.pixelbin.io",
};
const url = Pixelbin.url.objToUrl(obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:southwest)/images/transformation/basic_pink_flower.jpeg
from pixelbin.utils.url import obj_to_url
obj = {
"cloudName": "dummy-cloudname",
"zone": "FIDrmb",
"version": "v2",
"transformations": [{"name":"merge","plugin":"t","values":[{"key":"i","value":"X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key":"tr","value":"dC5yZXNpemUoaDoyMDAsdzoyMDAp"},{"key":"g","value":"southwest"}]}],
"filePath": "images/transformation/basic_pink_flower.jpeg",
"baseUrl": "https://cdn.pixelbin.io",
}
url = obj_to_url(obj)
# url
# https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:southwest)/images/transformation/basic_pink_flower.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{}{
{"plugin": "t", "name": "merge", "values": []map[string]interface{}{ {"key": "i", "value": "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key": "tr", "value": "dC5yZXNpemUoaDoyMDAsdzoyMDAp"},{"key": "g", "value": "southwest"},}},
},
"filePath": "images/transformation/basic_pink_flower.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/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:southwest)/images/transformation/basic_pink_flower.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(
TransformationObj( plugin = "t", name = "merge", values = hashMapOf( "i" to "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n","tr" to "dC5yZXNpemUoaDoyMDAsdzoyMDAp","g" to "southwest"), )
),
filePath = "images/transformation/basic_pink_flower.jpeg",
baseUrl = "https://cdn.pixelbin.io"
)
val url = Utils.objToUrl(obj)
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:southwest)/images/transformation/basic_pink_flower.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/basic_pink_flower.jpeg",
zone: "FIDrmb",
baseUrl: "https://cdn.pixelbin.io",
transformations: new List<UrlTransformation>() {
new UrlTransformation(plugin: "t", name: "merge", values: new List<Dictionary<string, string>>() { new Dictionary<string, string>() { { "key", "i" }, { "value", "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n" } }, new Dictionary<string, string>() { { "key", "tr" }, { "value", "dC5yZXNpemUoaDoyMDAsdzoyMDAp" } }, new Dictionary<string, string>() { { "key", "g" }, { "value", "southwest" } }} )
}
);
string url = Url.ObjToUrl(obj);
}
}
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:southwest)/images/transformation/basic_pink_flower.jpeg
<?php
require 'vendor/autoload.php';
use Pixelbin\Utils\Url;
$obj = [
"cloudName" => "dummy-cloudname",
"zone" => "FIDrmb",
"version" => "v2",
"options" => [],
"transformations" => [
["plugin" => "t", "name" => "merge", "values" => [ [ "key" => "i", "value" => "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n" ], [ "key" => "tr", "value" => "dC5yZXNpemUoaDoyMDAsdzoyMDAp" ], [ "key" => "g", "value" => "southwest" ], ], ],
],
"filePath" => "images/transformation/basic_pink_flower.jpeg",
"baseUrl" => "https://cdn.pixelbin.io",
];
$url = Url::obj_to_url($obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:southwest)/images/transformation/basic_pink_flower.jpeg
?>
- URL
- React
- JavaScript
- Node.js
- Python
- Golang
- Kotlin
- C#
- PHP
<PixelBinImage
url="https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:custom,t:200,l:125)/images/transformation/basic_pink_flower.jpeg"
/>
import Pixelbin from "@pixelbin/core";
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [{"name":"merge","plugin":"t","values":[{"key":"i","value":"X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key":"tr","value":"dC5yZXNpemUoaDoyMDAsdzoyMDAp"},{"key":"g","value":"custom"},{"key":"t","value":"200"},{"key":"l","value":"125"}]}],
filePath: "images/transformation/basic_pink_flower.jpeg",
baseUrl: "https://cdn.pixelbin.io",
};
const url = Pixelbin.default.utils.objToUrl(obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:custom,t:200,l:125)/images/transformation/basic_pink_flower.jpeg
const Pixelbin = require("@pixelbin/admin");
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [{"name":"merge","plugin":"t","values":[{"key":"i","value":"X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key":"tr","value":"dC5yZXNpemUoaDoyMDAsdzoyMDAp"},{"key":"g","value":"custom"},{"key":"t","value":"200"},{"key":"l","value":"125"}]}],
filePath: "images/transformation/basic_pink_flower.jpeg",
baseUrl: "https://cdn.pixelbin.io",
};
const url = Pixelbin.url.objToUrl(obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:custom,t:200,l:125)/images/transformation/basic_pink_flower.jpeg
from pixelbin.utils.url import obj_to_url
obj = {
"cloudName": "dummy-cloudname",
"zone": "FIDrmb",
"version": "v2",
"transformations": [{"name":"merge","plugin":"t","values":[{"key":"i","value":"X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key":"tr","value":"dC5yZXNpemUoaDoyMDAsdzoyMDAp"},{"key":"g","value":"custom"},{"key":"t","value":"200"},{"key":"l","value":"125"}]}],
"filePath": "images/transformation/basic_pink_flower.jpeg",
"baseUrl": "https://cdn.pixelbin.io",
}
url = obj_to_url(obj)
# url
# https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:custom,t:200,l:125)/images/transformation/basic_pink_flower.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{}{
{"plugin": "t", "name": "merge", "values": []map[string]interface{}{ {"key": "i", "value": "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key": "tr", "value": "dC5yZXNpemUoaDoyMDAsdzoyMDAp"},{"key": "g", "value": "custom"},{"key": "t", "value": "200"},{"key": "l", "value": "125"},}},
},
"filePath": "images/transformation/basic_pink_flower.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/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:custom,t:200,l:125)/images/transformation/basic_pink_flower.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(
TransformationObj( plugin = "t", name = "merge", values = hashMapOf( "i" to "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n","tr" to "dC5yZXNpemUoaDoyMDAsdzoyMDAp","g" to "custom","t" to "200","l" to "125"), )
),
filePath = "images/transformation/basic_pink_flower.jpeg",
baseUrl = "https://cdn.pixelbin.io"
)
val url = Utils.objToUrl(obj)
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:custom,t:200,l:125)/images/transformation/basic_pink_flower.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/basic_pink_flower.jpeg",
zone: "FIDrmb",
baseUrl: "https://cdn.pixelbin.io",
transformations: new List<UrlTransformation>() {
new UrlTransformation(plugin: "t", name: "merge", values: new List<Dictionary<string, string>>() { new Dictionary<string, string>() { { "key", "i" }, { "value", "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n" } }, new Dictionary<string, string>() { { "key", "tr" }, { "value", "dC5yZXNpemUoaDoyMDAsdzoyMDAp" } }, new Dictionary<string, string>() { { "key", "g" }, { "value", "custom" } }, new Dictionary<string, string>() { { "key", "t" }, { "value", "200" } }, new Dictionary<string, string>() { { "key", "l" }, { "value", "125" } }} )
}
);
string url = Url.ObjToUrl(obj);
}
}
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:custom,t:200,l:125)/images/transformation/basic_pink_flower.jpeg
<?php
require 'vendor/autoload.php';
use Pixelbin\Utils\Url;
$obj = [
"cloudName" => "dummy-cloudname",
"zone" => "FIDrmb",
"version" => "v2",
"options" => [],
"transformations" => [
["plugin" => "t", "name" => "merge", "values" => [ [ "key" => "i", "value" => "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n" ], [ "key" => "tr", "value" => "dC5yZXNpemUoaDoyMDAsdzoyMDAp" ], [ "key" => "g", "value" => "custom" ], [ "key" => "t", "value" => "200" ], [ "key" => "l", "value" => "125" ], ], ],
],
"filePath" => "images/transformation/basic_pink_flower.jpeg",
"baseUrl" => "https://cdn.pixelbin.io",
];
$url = Url::obj_to_url($obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDAp,g:custom,t:200,l:125)/images/transformation/basic_pink_flower.jpeg
?>
Blend (b
)
How to blend the two layers.
The default value is over
.
This parameter will only work for underlay and overlay modes.
Open to view the Blend options
Option | Description |
---|---|
over | Places the overlay image on top of the base image. |
in | The base image is removed completely. The overlay image appears exactly where the base and overlay image overlapped previously. |
out | Both images are removed from the screen. |
atop | Places the overlay image on top of the base image. |
dest | Shows the base image while the overlay image is completely removed. |
dest-over | The output here is similar to the over output except that the base image is placed on the overlay image. |
dest-i | The overlay image is removed and the base image is now visible in the previously overlapped area. |
dest-out | The overlay image is removed. The base image can be seen on the screen but both images are removed from the overlapping area. |
dest-atop | Places the base image on top of the overlay image. |
xor | Only the base image is visible, however, it's not drawn over the overlapping areas. |
add | Both images are available however the overlapping area is covered with the combination of their colours. |
saturate | The base image saturates the screen completely so that the overlay is no longer visible. |
multiply | The resulting output is a dark coloured version of the darker colour (either overlay or base image colours). |
screen | The resulting output is a light coloured version of the lighter colour (either overlay or base image colours). |
overlay | Blends both colours and gives a darker version of the base image. |
darken | Blends both colours depending on the darkness of the base image. |
lighten | Blends both colours depending on the lightness of the base image. |
colour-dodge | Brightens the base image colour. |
colour-burn | Darkens the base image colour. |
hard light | Multiplies both colours together depending on the lightness of the overlay image. |
soft light | Multiplies both colours together depending on the lightness of the base image. |
difference | Takes the difference of overlay and base image colours. |
exclusion | Similar to the output of difference but with less contrast. |
Tile (r
)
Repeat tile.
This boolean parameter repeats the overlay image like tiles over the image being processed. The default value is false.
This parameter will only work for underlay and overlay modes.
List of bboxes (bboxes
)
It is similar to the top, left, height, width
parameters. Just, instead of individual values, you can pass a list of n
such values.
The value must be a list of bboxes
, where a bbox
should be of the form: [top_left_height_width]
.
For instance, if you have a single box, then it will be [[top_left_height_width]]
for two boxes it will be [[top_left_height_width]_[top_left_height_width]]
, etc.
This parameter will only work for wrap mode.
List of polygons (polys
)
A list of polygons to allow you to map n
number of polygonal structures. A polygon allows you to pass a list of x
and y
coordinates. Each polygon must have only 4 coordinates.
The value must be a list of polygons, where a polygon should be of the form: [[x1_y1]_[x2_y2]_[x3_y3]_[x4_y4]]
.
For instance, if you have a single polygon, then it will be [[[x1_y1]_[x2_y2]_[x3_y3]_[x4_y4]]]
for two polygons it will be [[[x1_y1]_[x2_y2]_[x3_y3]_[x4_y4]]_[[x1_y1]_[x2_y2]_[x3_y3]_[x4_y4]]]
, etc.
This parameter will only work for wrap mode.
Wrap mode
Wrap mode allows users to overlay one image over another at multiple locations. User can either select rectangle boxes or polygons of varied shapes.
Only image (i)
, background (bg)
, bboxes
and polys
parameters can be used with wrap
mode.
Either bboxes
or polys
parameter is needed. Priority will be given to the bboxes
parameter if both bboxes
and polys
are passed.
- Original Image
- bboxes and image
- polys and image
- URL
- React
- JavaScript
- Node.js
- Python
- Golang
- Kotlin
- C#
- PHP
<PixelBinImage
url="https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/basic_white_flower.jpeg"
/>
import Pixelbin from "@pixelbin/core";
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [],
filePath: "images/transformation/basic_white_flower.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/basic_white_flower.jpeg
const Pixelbin = require("@pixelbin/admin");
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [],
filePath: "images/transformation/basic_white_flower.jpeg",
baseUrl: "https://cdn.pixelbin.io",
};
const url = Pixelbin.url.objToUrl(obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/basic_white_flower.jpeg
from pixelbin.utils.url import obj_to_url
obj = {
"cloudName": "dummy-cloudname",
"zone": "FIDrmb",
"version": "v2",
"transformations": [],
"filePath": "images/transformation/basic_white_flower.jpeg",
"baseUrl": "https://cdn.pixelbin.io",
}
url = obj_to_url(obj)
# url
# https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/basic_white_flower.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/basic_white_flower.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/basic_white_flower.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/basic_white_flower.jpeg",
baseUrl = "https://cdn.pixelbin.io"
)
val url = Utils.objToUrl(obj)
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/basic_white_flower.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/basic_white_flower.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/basic_white_flower.jpeg
<?php
require 'vendor/autoload.php';
use Pixelbin\Utils\Url;
$obj = [
"cloudName" => "dummy-cloudname",
"zone" => "FIDrmb",
"version" => "v2",
"options" => [],
"transformations" => [
],
"filePath" => "images/transformation/basic_white_flower.jpeg",
"baseUrl" => "https://cdn.pixelbin.io",
];
$url = Url::obj_to_url($obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/original/images/transformation/basic_white_flower.jpeg
?>
Boxes dimensions: [10, 10, 100, 100]
[200, 20, 100, 100]
- URL
- React
- JavaScript
- Node.js
- Python
- Golang
- Kotlin
- C#
- PHP
<PixelBinImage
url="https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,bboxes:[[10_10_100_100]_[200_20_100_100]])/images/transformation/basic_white_flower.jpeg"
/>
import Pixelbin from "@pixelbin/core";
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [{"name":"merge","plugin":"t","values":[{"key":"m","value":"wrap"},{"key":"i","value":"X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key":"tr","value":"dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk"},{"key":"bboxes","value":"[[10_10_100_100]_[200_20_100_100]]"}]}],
filePath: "images/transformation/basic_white_flower.jpeg",
baseUrl: "https://cdn.pixelbin.io",
};
const url = Pixelbin.default.utils.objToUrl(obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,bboxes:[[10_10_100_100]_[200_20_100_100]])/images/transformation/basic_white_flower.jpeg
const Pixelbin = require("@pixelbin/admin");
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [{"name":"merge","plugin":"t","values":[{"key":"m","value":"wrap"},{"key":"i","value":"X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key":"tr","value":"dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk"},{"key":"bboxes","value":"[[10_10_100_100]_[200_20_100_100]]"}]}],
filePath: "images/transformation/basic_white_flower.jpeg",
baseUrl: "https://cdn.pixelbin.io",
};
const url = Pixelbin.url.objToUrl(obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,bboxes:[[10_10_100_100]_[200_20_100_100]])/images/transformation/basic_white_flower.jpeg
from pixelbin.utils.url import obj_to_url
obj = {
"cloudName": "dummy-cloudname",
"zone": "FIDrmb",
"version": "v2",
"transformations": [{"name":"merge","plugin":"t","values":[{"key":"m","value":"wrap"},{"key":"i","value":"X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key":"tr","value":"dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk"},{"key":"bboxes","value":"[[10_10_100_100]_[200_20_100_100]]"}]}],
"filePath": "images/transformation/basic_white_flower.jpeg",
"baseUrl": "https://cdn.pixelbin.io",
}
url = obj_to_url(obj)
# url
# https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,bboxes:[[10_10_100_100]_[200_20_100_100]])/images/transformation/basic_white_flower.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{}{
{"plugin": "t", "name": "merge", "values": []map[string]interface{}{ {"key": "m", "value": "wrap"},{"key": "i", "value": "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key": "tr", "value": "dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk"},{"key": "bboxes", "value": "[[10_10_100_100]_[200_20_100_100]]"},}},
},
"filePath": "images/transformation/basic_white_flower.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/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,bboxes:[[10_10_100_100]_[200_20_100_100]])/images/transformation/basic_white_flower.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(
TransformationObj( plugin = "t", name = "merge", values = hashMapOf( "m" to "wrap","i" to "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n","tr" to "dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk","bboxes" to "[[10_10_100_100]_[200_20_100_100]]"), )
),
filePath = "images/transformation/basic_white_flower.jpeg",
baseUrl = "https://cdn.pixelbin.io"
)
val url = Utils.objToUrl(obj)
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,bboxes:[[10_10_100_100]_[200_20_100_100]])/images/transformation/basic_white_flower.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/basic_white_flower.jpeg",
zone: "FIDrmb",
baseUrl: "https://cdn.pixelbin.io",
transformations: new List<UrlTransformation>() {
new UrlTransformation(plugin: "t", name: "merge", values: new List<Dictionary<string, string>>() { new Dictionary<string, string>() { { "key", "m" }, { "value", "wrap" } }, new Dictionary<string, string>() { { "key", "i" }, { "value", "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n" } }, new Dictionary<string, string>() { { "key", "tr" }, { "value", "dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk" } }, new Dictionary<string, string>() { { "key", "bboxes" }, { "value", "[[10_10_100_100]_[200_20_100_100]]" } }} )
}
);
string url = Url.ObjToUrl(obj);
}
}
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,bboxes:[[10_10_100_100]_[200_20_100_100]])/images/transformation/basic_white_flower.jpeg
<?php
require 'vendor/autoload.php';
use Pixelbin\Utils\Url;
$obj = [
"cloudName" => "dummy-cloudname",
"zone" => "FIDrmb",
"version" => "v2",
"options" => [],
"transformations" => [
["plugin" => "t", "name" => "merge", "values" => [ [ "key" => "m", "value" => "wrap" ], [ "key" => "i", "value" => "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n" ], [ "key" => "tr", "value" => "dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk" ], [ "key" => "bboxes", "value" => "[[10_10_100_100]_[200_20_100_100]]" ], ], ],
],
"filePath" => "images/transformation/basic_white_flower.jpeg",
"baseUrl" => "https://cdn.pixelbin.io",
];
$url = Url::obj_to_url($obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,bboxes:[[10_10_100_100]_[200_20_100_100]])/images/transformation/basic_white_flower.jpeg
?>
Polygons coordinates: [[10, 20], [110, 20], [120, 140], [10, 140]]
[[210, 220], [120, 220], [60, 340], [280, 340]]
- URL
- React
- JavaScript
- Node.js
- Python
- Golang
- Kotlin
- C#
- PHP
<PixelBinImage
url="https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,polys:[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]/images/transformation/basic_white_flower.jpeg"
/>
import Pixelbin from "@pixelbin/core";
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [{"name":"merge","plugin":"t","values":[{"key":"m","value":"wrap"},{"key":"i","value":"X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key":"tr","value":"dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk"},{"key":"polys","value":"[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]"}]}],
filePath: "images/transformation/basic_white_flower.jpeg",
baseUrl: "https://cdn.pixelbin.io",
};
const url = Pixelbin.default.utils.objToUrl(obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,polys:[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]/images/transformation/basic_white_flower.jpeg
const Pixelbin = require("@pixelbin/admin");
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [{"name":"merge","plugin":"t","values":[{"key":"m","value":"wrap"},{"key":"i","value":"X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key":"tr","value":"dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk"},{"key":"polys","value":"[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]"}]}],
filePath: "images/transformation/basic_white_flower.jpeg",
baseUrl: "https://cdn.pixelbin.io",
};
const url = Pixelbin.url.objToUrl(obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,polys:[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]/images/transformation/basic_white_flower.jpeg
from pixelbin.utils.url import obj_to_url
obj = {
"cloudName": "dummy-cloudname",
"zone": "FIDrmb",
"version": "v2",
"transformations": [{"name":"merge","plugin":"t","values":[{"key":"m","value":"wrap"},{"key":"i","value":"X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key":"tr","value":"dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk"},{"key":"polys","value":"[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]"}]}],
"filePath": "images/transformation/basic_white_flower.jpeg",
"baseUrl": "https://cdn.pixelbin.io",
}
url = obj_to_url(obj)
# url
# https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,polys:[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]/images/transformation/basic_white_flower.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{}{
{"plugin": "t", "name": "merge", "values": []map[string]interface{}{ {"key": "m", "value": "wrap"},{"key": "i", "value": "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n"},{"key": "tr", "value": "dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk"},{"key": "polys", "value": "[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]"},}},
},
"filePath": "images/transformation/basic_white_flower.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/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,polys:[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]/images/transformation/basic_white_flower.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(
TransformationObj( plugin = "t", name = "merge", values = hashMapOf( "m" to "wrap","i" to "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n","tr" to "dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk","polys" to "[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]"), )
),
filePath = "images/transformation/basic_white_flower.jpeg",
baseUrl = "https://cdn.pixelbin.io"
)
val url = Utils.objToUrl(obj)
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,polys:[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]/images/transformation/basic_white_flower.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/basic_white_flower.jpeg",
zone: "FIDrmb",
baseUrl: "https://cdn.pixelbin.io",
transformations: new List<UrlTransformation>() {
new UrlTransformation(plugin: "t", name: "merge", values: new List<Dictionary<string, string>>() { new Dictionary<string, string>() { { "key", "m" }, { "value", "wrap" } }, new Dictionary<string, string>() { { "key", "i" }, { "value", "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n" } }, new Dictionary<string, string>() { { "key", "tr" }, { "value", "dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk" } }, new Dictionary<string, string>() { { "key", "polys" }, { "value", "[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]" } }} )
}
);
string url = Url.ObjToUrl(obj);
}
}
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,polys:[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]/images/transformation/basic_white_flower.jpeg
<?php
require 'vendor/autoload.php';
use Pixelbin\Utils\Url;
$obj = [
"cloudName" => "dummy-cloudname",
"zone" => "FIDrmb",
"version" => "v2",
"options" => [],
"transformations" => [
["plugin" => "t", "name" => "merge", "values" => [ [ "key" => "m", "value" => "wrap" ], [ "key" => "i", "value" => "X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n" ], [ "key" => "tr", "value" => "dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk" ], [ "key" => "polys", "value" => "[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]" ], ], ],
],
"filePath" => "images/transformation/basic_white_flower.jpeg",
"baseUrl" => "https://cdn.pixelbin.io",
];
$url = Url::obj_to_url($obj);
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.merge(m:wrap,i:X19kb2NzX2Fzc2V0cy9zdW4tNTI3NzQ5MV82NDAucG5n,tr:dC5yZXNpemUoaDoyMDAsdzoyMDApfmVyYXNlLmJnKCk,polys:[[[10_20]_[110_20]_[120_140]_[10_140]]_[[210_220]_[120_220]_[60_340]_[280_340]]]/images/transformation/basic_white_flower.jpeg
?>