Image Transformation

Encoding.com offers an image manipulation and optimization service that will provide a wide variety of image to image conversion options.

<?xml version="1.0"?>
<query>
    <userid>[UserID]</userid> <!-- required-->
    <userkey>[UserKey]</userkey> <!-- required-->
    <action>[Action]</action> <!-- required-->
    <format>
        <!-- Format fields -->
        <output>image</output>
        <image_format>jpg</image_format> <!-- required-->
        <resize_method>resize</resize_method>
        <size>560x420</size>
        <keep_aspect_ratio>yes</keep_aspect_ratio>
        <quality>75</quality>
        <dpi>72</dpi>
        <sharpen_radius>1</sharpen_radius>
        <sharpen_sigma>0.5</sharpen_sigma>
        <remove_metadata>no</remove_metadata>
        <gravity>[northwest|north|northeast|west|center|east|southwest|south|southeast]</gravity>
        <shave>[9x12]</shave>
        <unsharp_radius>2.0</unsharp_radius>
        <unsharp_sigma>1.0</unsharp_sigma>
        <unsharp_gain>1.0</unsharp_gain>
        <unsharp_threshold>0.05</unsharp_threshold>
        <!-- Destination fields -->
        <destination>[DestFile]</destination>
    </format>
</query>
{
    "query": {
        "userid": "[UserID]",
        "userkey": "[UserKey]",
        "action": "[Action]",
        "format": {
            "output": "image",
            "image_format": "jpg",
            "resize_method": "resize",
            "size": "560x420",
            "keep_aspect_ratio": "yes",
            "quality": "75",
            "dpi": "72",
            "sharpen_radius": "1",
            "sharpen_sigma": "0.5",
            "remove_metadata": "no",
            "gravity": "[northwest|north|northeast|west|center|east|southwest|south|southeast]",
            "shave": "[9x12]",
            "unsharp_radius": "2.0",
            "unsharp_sigma": "1.0",
            "unsharp_gain": "1.0",
            "unsharp_threshold": "0.05",
            "destination": "[DestFile]"
        }
    }
}
ParameterDescriptionAllowed ValuesDefault Value
image_formatSpecify the output format.jpg, png, gif, tiffjpg
sizeSpecify the size of the output.WxH or Wx0 or 0xH or Wx or xH, where W and H are positive integers.None
keep_aspect_ratioSpecify whether to keep width to height ratio of original picture.yes, noyes
resize_methodSpecify how the original picture will be transformed to new size.resize, crop, combineresize
quality
Specify the level of JPEG quality.jpg: 1-100
All: none
80
dpiSpecify the image DPI.71-120072
sharpen_radiusSpecify the output sharpen radius.0-100
sharpen_sigma
Specify the amount of image sharpening. (recommendation is 0.5-1.0)Float: 0, 0.2-100.5
gravitySets the current gravity suggestion for various other options.northwest, north, northeast, west, center, east, southwest, south, southeastNone
remove_metadataSpecify whether to remove image metadata including EXIF.yes, nono
shave
Specify how many pixels to shave from the image edges.WxHNone
unsharp_radiusSpecify the radius of the gaussian.In pixels, not counting the center pixel, should be larger than unsharp_sigma. Use a radius of 0 to have the method select a suitable radius.None.
unsharp_sigmaSpecify the standard deviation of the gaussian.In pixels1.0
unsharp_gain
Specify the fraction of the difference between the original and the blur image that is added back into the original.Float1.0
unsharp_thresholdSpecify the threshold, as a fraction of QuantumRange, needed to apply the difference amount.Float0.05

❗️

For image_format parameter

<image_format /> is a required field.

🚧

For keep_aspect_ratio parameter

If either or is set to 0, <keep_aspect_ratio /> will be yes.