How Can We Help You?

Filtering

From several forms of image blurring to duotone, blur, sepia or pixelate to color replacement, the Picsmize Image API gives you with a strong toolbelt of the finest quality filters you can apply to your images. Of course, you may stack as many different filters as you want.

All filtering parameters must be given in a filter hash, and every filter must accept a value that is a positive float in the range of 0 to 100 at the very least.

Duotone

This highly artistic filter maps two input colors to an image's darks and lights. Only the shades of the two input colors are represented in the final image.

The light and dark parameters of the Duotone filter are color values that are mapped onto the grayscale input image. Both parameters accept a color value in RRGGBB format as a hex-encoded string.

<?php

/**
* Instantiate new `$picsmize` by calling a constructor
*/

$picsmize = new Picsmize('your-api-key');

/**
* Provide a publicly available image URL with fetch(string) method,
* and apply duotone filter
*/

$picsmize
->fetch('https://www.example.com/image.jpg')
->filter(Picsmize::FILTER_DUOTONE, array(
'light' => "#85ffa6",
'dark' => "#961621"
))
->toJSON(function ($response) {
if ($response['status'] == false) {
throw new Exception($response);
}

/**
* You'll find the full JSON metadata array within the `$response` variable.
* Remember to always check if the `status` property is set to `true`.
*/

if ($response['status'] == true) {
print ($response['output']['src']);
} else {
print ($response['message']);
}
});
curl -X POST \
https://api.picsmize.com/image/process \
-H "apikey: your-api-key" \
-H "content-type: application/json" \
-d '{
"img_url": "https://www.example.com/image.jpg",
"process": {
"filter": {
"duotone": {
"light": "#85ffa6",
"dark": "#961621"
}
}
}
}'
									
										package main

										import (
											"fmt"

											"github.com/picsmize/picsmize-go"
										)

										func main() {

											pics, err := picsmize.Init("your-api-key")
											if err != nil {
												panic(err)
											}
											
											/**
											* Provide a publicly available image URL with fetch(string) method,
											* and apply duotone filter
											*/

											res, err := pics.Fetch("your-image-url").
												Filter("duotone", picsmize.Options{
													"light": "#85ffa6",
													"dark": "#961621",
												}).
												ToJSON()

											if err != nil {
												panic(err)
											}

											/**
											* You'll find the full JSON metadata within the `res` variable.
											*/

											fmt.Println(res)
										}
									
								
Resizing An Image Online
Compressor Photo
Image Online Resize
Gaussian Blur

One of the most often used blurring algorithms is this one. It blurs pixels by using a convolution kernel that adds a fraction of the color of surrounding pixels to the mix. Sharp color transitions will appear more gradual as a result of this, resulting in visual softness or blur.

To use the Gaussian Blur filter, change the blur filter mode to gaussian and select a value that takes a float between 0 and 100 and indicates how much blur is applied to the input image.

<?php

/**
* Instantiate new `$picsmize` by calling a constructor
*/

$picsmize = new Picsmize('your-api-key');

/**
* Provide a publicly available image URL with fetch(string) method,
* and apply blur filter with gaussian mode,
* and value set to 10
*/

$picsmize
->fetch('https://www.example.com/image.jpg')
->filter(Picsmize::FILTER_BLUR, array(
'mode' => "gaussian",
'value' => 10
))
->toJSON(function ($response) {
if ($response['status'] == false) {
throw new Exception($response);
}

/**
* You'll find the full JSON metadata array within the `$response` variable.
* Remember to always check if the `status` property is set to `true`.
*/

if ($response['status'] == true) {
print ($response['output']['src']);
} else {
print ($response['message']);
}
});
curl -X POST \
https://api.picsmize.com/image/process \
-H "apikey: your-api-key" \
-H "content-type: application/json" \
-d '{
"img_url": "https://www.example.com/image.jpg",
"process": {
"filter": {
"blur": {
"mode": "gaussian",
"value": 10
}
}
}
}'
									
										package main

										import (
											"fmt"

											"github.com/picsmize/picsmize-go"
										)

										func main() {

											pics, err := picsmize.Init("your-api-key")
											if err != nil {
												panic(err)
											}
											
											/**
											* Provide a publicly available image URL with fetch(string) method,
											* and apply blur filter with gaussian mode,
											* and value set to 10
											*/

											res, err := pics.Fetch("your-image-url").
												Filter("blur", picsmize.Options{
													"mode": "gaussian",
													"value": 10,
												}).
												ToJSON()

											if err != nil {
												panic(err)
											}

											/**
											* You'll find the full JSON metadata within the `res` variable.
											*/

											fmt.Println(res)
										}
									
								
Compress Jpeg
Compressing An Image
Compress The Photo
Motion Blur

Motion Blur simulates the streak-like effect of a moving object, which is commonly created by snapping a shot with a longer exposure time (slower shutter speed).

To use the Motion Blur filter, change the blur filter mode to motion and enter a number that is a float between 0 and 100 that indicates the degree of blur applied to the input image.

The angle parameter, which accepts an integer between 0 and 360 and indicates the direction in which the pixels will be scattered throughout the image, is optional. The angle is set to 90 degrees by default.

<?php

/**
* Instantiate new `$picsmize` by calling a constructor
*/

$picsmize = new Picsmize('your-api-key');

/**
* Provide a publicly available image URL with fetch(string) method,
* and apply blur filter with motion mode,
* value set to 10 and angle set to 90
*/

$picsmize
->fetch('https://www.example.com/image.jpg')
->filter(Picsmize::FILTER_BLUR, array(
'mode' => "motion",
'value' => 10,
'angle' => 90
))
->toJSON(function ($response) {
if ($response['status'] == false) {
throw new Exception($response);
}

/**
* You'll find the full JSON metadata array within the `$response` variable.
* Remember to always check if the `status` property is set to `true`.
*/

if ($response['status'] == true) {
print ($response['output']['src']);
} else {
print ($response['message']);
}
});
curl -X POST \
https://api.picsmize.com/image/process \
-H "apikey: your-api-key" \
-H "content-type: application/json" \
-d '{
"img_url": "https://www.example.com/image.jpg",
"process": {
"filter": {
"blur": {
"mode": "motion",
"value": 10,
"angle": 90
}
}
}
}'
									
										package main

										import (
											"fmt"

											"github.com/picsmize/picsmize-go"
										)

										func main() {

											pics, err := picsmize.Init("your-api-key")
											if err != nil {
												panic(err)
											}
											
											/**
											* Provide a publicly available image URL with fetch(string) method,
											* and apply blur filter with motion mode,
											* value set to 10 and angle set to 90
											*/

											res, err := pics.Fetch("your-image-url").
												Filter("blur", picsmize.Options{
													"mode": "motion",
													"value": 10,
													"angle": 90,
												}).
												ToJSON()

											if err != nil {
												panic(err)
											}

											/**
											* You'll find the full JSON metadata within the `res` variable.
											*/

											fmt.Println(res)
										}
									
								
Images Size Reducer
Resizing Of Image
Resizing An Image Online
Sepia

Changes the color of each pixel in the image such that they are reddish-brown in tone.

To utilize the Sepia filter, you must first specify the sepia hash.

<?php

/**
* Instantiate new `$picsmize` by calling a constructor
*/

$picsmize = new Picsmize('your-api-key');

/**
* Provide a publicly available image URL with fetch(string) method,
* and apply sepia filter.
*/

$picsmize
->fetch('https://www.example.com/image.jpg')
->filter(Picsmize::FILTER_SEPIA)
->toJSON(function ($response) {
if ($response['status'] == false) {
throw new Exception($response);
}

/**
* You'll find the full JSON metadata array within the `$response` variable.
* Remember to always check if the `status` property is set to `true`.
*/

if ($response['status'] == true) {
print ($response['output']['src']);
} else {
print ($response['message']);
}
});
curl -X POST \
https://api.picsmize.com/image/process \
-H "apikey: your-api-key" \
-H "content-type: application/json" \
-d '{
"img_url": "https://www.example.com/image.jpg",
"process": {
"filter": {
"sepia": {}
}
}
}'
									
										package main

										import (
											"fmt"

											"github.com/picsmize/picsmize-go"
										)

										func main() {

											pics, err := picsmize.Init("your-api-key")
											if err != nil {
												panic(err)
											}
											
											/**
											* Provide a publicly available image URL with fetch(string) method,
											* and apply sepia filter.
											*/

											res, err := pics.Fetch("your-image-url").
												Filter("sepia", picsmize.Options{}).
												ToJSON()

											if err != nil {
												panic(err)
											}

											/**
											* You'll find the full JSON metadata within the `res` variable.
											*/

											fmt.Println(res)
										}
									
								
Resizing Pictures
Compress A Png
Compress Jpeg
Pixelate

Pixelates an image by converting it into colored squares whose color is determined by the average of the pixels that have been replaced.

To utilize the Pixelate filter, you must first set a value in the pixellate hash, which accepts a float between 0 and 100 and describes the size of image pixelation.

<?php

/**
* Instantiate new `$picsmize` by calling a constructor
*/

$picsmize = new Picsmize('your-api-key');

/**
* Provide a publicly available image URL with fetch(string) method,
* and apply pixelate filter,
* and value set to 10
*/

$picsmize
->fetch('https://www.example.com/image.jpg')
->filter(Picsmize::FILTER_PIXELLATE, array(
'value' => 10
))
->toJSON(function ($response) {
if ($response['status'] == false) {
throw new Exception($response);
}

/**
* You'll find the full JSON metadata array within the `$response` variable.
* Remember to always check if the `status` property is set to `true`.
*/

if ($response['status'] == true) {
print ($response['output']['src']);
} else {
print ($response['message']);
}
});
curl -X POST \
https://api.picsmize.com/image/process \
-H "apikey: your-api-key" \
-H "content-type: application/json" \
-d '{
"img_url": "https://www.example.com/image.jpg",
"process": {
"filter": {
"pixellate": {
"value": 10
}
}
}
}'
									
										package main

										import (
											"fmt"

											"github.com/picsmize/picsmize-go"
										)

										func main() {

											pics, err := picsmize.Init("your-api-key")
											if err != nil {
												panic(err)
											}
											
											/**
											* Provide a publicly available image URL with fetch(string) method,
											* and apply pixelate filter,
											* and value set to 10
											*/

											res, err := pics.Fetch("your-image-url").
												Filter("pixelate", picsmize.Options{
													"value" => 10,
												}).
												ToJSON()

											if err != nil {
												panic(err)
											}

											/**
											* You'll find the full JSON metadata within the `res` variable.
											*/

											fmt.Println(res)
										}
									
								
Compressing An Image
Compress The Photo
Images Size Reducer