Modulate an image
Modulate transformation allows users to adjust the brightness, saturation and hue of an image.
Brightness adjustment involves changing the overall lightness or darkness of the image. Increasing the brightness makes the image lighter, while decreasing it makes the image darker.
Saturation adjustment involves changing the intensity or purity of the colors in the image. Increasing the saturation makes the colors more intense and vibrant, while decreasing it makes the colors more muted and subdued.
Hue adjustment involves changing the color tone of the image. It can be used to correct color casts or to create a specific color effect. Hue adjustment changes the color of the entire image, shifting it towards a different color.
When adjusting the brightness, saturation, and hue of an image, it is important to be subtle and not overdo the adjustments. Over-adjustment can result in an image that looks unnatural or unrealistic. It is also important to ensure that the adjustments are applied uniformly across the image and do not create visible seams or transitions.
Params
Brightness (b
)
Brightness multiplier.
Available values are from 1
to 10
. The default value is 1
.
Saturation (s
)
Saturation multiplier.
Available values are from 0
to 10
. The default value for saturation is 1
.
Hue (h
)
Degrees for hue rotation.
Available values are from -360
to 360
. The default value is 90
.
- Original Image
- Modulate with brightness=1, hue=1, saturation=2
- 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.modulate(b:1,h:1,s:2)/images/transformation/basic_pink_flower.jpeg"
/>
import Pixelbin from "@pixelbin/core";
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [{"name":"modulate","plugin":"t","values":[{"key":"b","value":"1"},{"key":"h","value":"1"},{"key":"s","value":"2"}]}],
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.modulate(b:1,h:1,s:2)/images/transformation/basic_pink_flower.jpeg
const Pixelbin = require("@pixelbin/admin");
const obj = {
cloudName: "dummy-cloudname",
zone: "FIDrmb",
version: "v2",
transformations: [{"name":"modulate","plugin":"t","values":[{"key":"b","value":"1"},{"key":"h","value":"1"},{"key":"s","value":"2"}]}],
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.modulate(b:1,h:1,s:2)/images/transformation/basic_pink_flower.jpeg
from pixelbin.utils.url import obj_to_url
obj = {
"cloudName": "dummy-cloudname",
"zone": "FIDrmb",
"version": "v2",
"transformations": [{"name":"modulate","plugin":"t","values":[{"key":"b","value":"1"},{"key":"h","value":"1"},{"key":"s","value":"2"}]}],
"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.modulate(b:1,h:1,s:2)/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": "modulate", "values": []map[string]interface{}{ {"key": "b", "value": "1"},{"key": "h", "value": "1"},{"key": "s", "value": "2"},}},
},
"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.modulate(b:1,h:1,s:2)/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 = "modulate", values = hashMapOf( "b" to "1","h" to "1","s" to "2"), )
),
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.modulate(b:1,h:1,s:2)/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: "modulate", values: new List<Dictionary<string, string>>() { new Dictionary<string, string>() { { "key", "b" }, { "value", "1" } }, new Dictionary<string, string>() { { "key", "h" }, { "value", "1" } }, new Dictionary<string, string>() { { "key", "s" }, { "value", "2" } }} )
}
);
string url = Url.ObjToUrl(obj);
}
}
}
// url
// https://cdn.pixelbin.io/v2/dummy-cloudname/FIDrmb/t.modulate(b:1,h:1,s:2)/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" => "modulate", "values" => [ [ "key" => "b", "value" => "1" ], [ "key" => "h", "value" => "1" ], [ "key" => "s", "value" => "2" ], ], ],
],
"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.modulate(b:1,h:1,s:2)/images/transformation/basic_pink_flower.jpeg
?>