Manual Adjustments

Image Operations / Manual Adjustments

On this page:
Intro ▾
{{activeSubMenu.text}} ▾

The Pixaven Image API enables you to fine tune every single visual aspect of your images. If you like to play with saturation, brightness or shadow details, you'll feel right at home. As with all API requests, you can combine multiple operations together to create truly unique visuals.

All manual adjustments must be passed in an adjust hash:

{
    "adjust": {
        "contrast": 20
    }
}

An example cURL request to adjust the contrast value will look like the following:

curl https://api.pixaven.com/1.0/fetch
     --user your-api-key: \
     --header "Content-Type: application/json" \
     --data '{
         "url": "https://www.website.com/image.jpg",
         "adjust": {
             "contrast": 20
         }
     }'

Brightness

The brightness parameter takes an integer value within the range -100 - 100:

{
    "adjust": {
        "brightness": 10
    }
}
Adjusted
Original

Saturation

The saturation parameter takes an integer value within the range -100 - 100:

{
    "adjust": {
        "saturation": 10
    }
}
Adjusted
Original

Contrast

The contrast parameter takes an integer value within the range -100 - 100:

{
    "adjust": {
        "contrast": 10
    }
}
Adjusted
Original

Exposure

The exposure parameter takes an integer value within the range -100 - 100:

{
    "adjust": {
        "exposure": 10
    }
}
Adjusted
Original

Vibrance

The vibrance parameter takes an integer value within the range -100 - 100:

{
    "adjust": {
        "vibrance": 10
    }
}
Adjusted
Original

Gamma

The gamma parameter takes an integer value within the range -100 - 100:

{
    "adjust": {
        "gamma": 10
    }
}
Adjusted
Original

Hue

The hue parameter takes an integer value within the range -180 - 180:

{
    "adjust": {
        "hue": 10
    }
}
Adjusted
Original

Highlight

The highlight parameter takes an integer value within the range -100 - 0:

{
    "adjust": {
        "highlight": -50
    }
}
Adjusted
Original

Shadow

The shadow parameter takes an integer value within the range 0 - 100:

{
    "adjust": {
        "shadow": 10
    }
}
Adjusted
Original

Sharpen

The sharpen parameter takes an integer value within the range -100 - 100:

{
    "adjust": {
        "sharpen": 10
    }
}
Adjusted
Original

Unsharp Mask

The unsharp parameter takes an integer value within the range 0 - 100:

{
    "adjust": {
        "unsharp": 10
    }
}
Adjusted
Original

Temperature

The temperature parameter takes an integer value within the range 0 - 100:

{
    "adjust": {
        "temperature": 10
    }
}
Adjusted
Original

Tint

The tint parameter takes an integer value within the range 0 - 100:

{
    "adjust": {
        "tint": 10
    }
}
Adjusted
Original

Invert

The invert parameter takes a boolean value:

{
    "adjust": {
        "invert": true
    }
}
Adjusted
Original

Code Examples for Manual Adjustments

Below, you'll find examples of how to use Manual Adjustments from the Pixaven API:

<?php

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

$pix = new Pixaven\Pixaven('your-api-key');


/**
* Provide a publicly available image URL with fetch(string) method
* and adjust image saturation, vibrance and sharpness (with Unsharp Mask)
*/

$pix
    ->fetch('https://www.website.com/image.jpg')
    ->adjust(array(
        'saturation' => 20,
        'vibrance' => 50,
        'unsharp' => 10
    ))
    ->toJSON(function ($error, $meta) {
        if (!empty($error)) {
            throw new Exception($error);
        }

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

        if ($meta['success'] == true) {
            print ($meta['output']['url']);
        } else {
            print ($meta['message']);
        }
    });
/**
* Module dependencies
*/

const Pixaven = require("pixaven");


/**
* Instantiate new `pix` by calling a constructor
*/

const pix = new Pixaven("your-api-key");


/**
* Provide a publicly available image URL with fetch(string) method
* and adjust image saturation, vibrance and sharpness (with Unsharp Mask)
*/

pix
    .fetch("https://www.website.com/image.jpg")
    .adjust({
        saturation: 20,
        vibrance: 50,
        unsharp: 10
    })
    .toJSON((err, meta) => {
        if (err) {
            return console.log(err);
        }

        /**
        * You'll find the full JSON metadata hash within the `meta` variable.
        * Remember to always check if the `success` property is set to `true`.
        */

        if (meta.success) {
            console.log(meta.output.url);
        } else {
            console.log(meta.message);
        }
    });
##
# Require dependencies

require "pixaven"


##
# Instantiate new `pix` by calling a constructor

pix = Pixaven.new("your-api-key")


##
# Provide a publicly available image URL with fetch(string) method
# and adjust image saturation, vibrance and sharpness (with Unsharp Mask)

err, meta = pix
    .fetch("https://www.website.com/image.jpg")
    .adjust(
        saturation: 20,
        vibrance: 50,
        unsharp: 10
    )
    .to_json

abort(err) if err


##
# You'll find the full JSON metadata hash within the `meta` variable.
# Remember to always check if the `success` property is set to `true`.

if meta["success"]
    puts meta["output"]["url"]
else
    puts meta["message"]
end
package main

import (
    "fmt"
    "github.com/pixaven/pixaven-go"
)

func main() {

    /**
    * Instantiate new `pix` by calling a constructor
    */

    pix, err := pixaven.NewClient("your-api-key")

    if err != nil {
        panic(err)
    }


    /**
    * Provide a publicly available image URL with Fetch(string) method
    * and adjust image saturation, vibrance and sharpness (with Unsharp Mask)
    */

    meta, err := pix.
        Fetch("https://www.website.com/image.jpg").
        Adjust(pixaven.P{
            "saturation": 20,
            "vibrance": 50,
            "unsharp": 10
        }).
        ToJSON()

    if err != nil {
        panic(err)
    }


    /**
    * You'll find the full JSON metadata hash within the `meta` variable.
    * Remember to always check if the `success` property is set to `true`.
    */

    if meta["success"].(map[string]interface{})["success"].(bool) {
        fmt.Println(meta["output"].(map[string]interface{})["url"])
    } else {
        fmt.Println(meta["message"])
    }
}
##
# Import dependencies

from pixaven import pixaven


##
# Instantiate new `client` by calling a constructor

client = pixaven('your-api-key')


##
# Provide a publicly available image URL with fetch(string) method
# and adjust image saturation, vibrance and sharpness (with Unsharp Mask)

err, meta = (
    client
        .fetch('https://www.website.com/image.jpg')
        .adjust({
            'saturation': 20,
            'vibrance': 50,
            'unsharp': 10
        })
        .toJSON()
)

if err is not None:
    raise StandardError(err)


##
# You'll find the full JSON metadata hash within the `meta` variable.
# Remember to always check if the `success` property is set to `true`.

if meta['success'] is True:
    print (meta['output']['url'])
else:
    print (meta['message'])
package com.pixaven.examples;

/**
* Import dependencies
*/

import static com.pixaven.OperationConfiguration.settings;
import com.pixaven.Pixaven;
import com.pixaven.Fetch;
import com.pixaven.Response;

public class Adjustments {
    public static void main(String[] args) {

        /**
        * Instantiate new `pix` by calling a constructor
        */

        Pixaven pix = new Pixaven("your-api-key");

        /**
         * Provide a publicly available image URL with fetch(string) method
         * and adjust image saturation, vibrance and sharpness (with Unsharp Mask)
         */

        final Fetch fetch = pix.fetch("https://www.website.com/image.jpg");

        fetch.adjust(
            settings()
                .set("saturation", 20)
                .set("vibrance", 50)
                .set("unsharp", 10)
        );

        final Response response = fetch.toJson();

        /**
        * You'll find the full JSON metadata hash within the `Response#getMetadata()` variable.
        * Remember to always check if the `Response#successful` property is set to `true`.
        */

        if (response.isSuccessful()) {
            System.out.println(response.getMetadata().getOutput().get("url"));
        } else {
            System.out.println(response.getMessage());
        }
    }
}

We use both proprietary and third-party cookies to improve your browsing experience and to provide you with a better service. By continuing to use this site you consent our use of cookies as described in our Cookie Policy×