Did not manage to get the upscaler working at all – but that’s okay. I am now working without it.
My next step is to use the imagga API to pull the color profile for images. Here is the info:
/colors
GET Request:
curl --user “acc_62606e731a1ac79:03acd65c496f9abf46b0c0ab86c2c13a” “https://api.imagga.com/v2/colors?image_url=https://imagga.com/static/images/tagging/wind-farm-538576_640.jpg”
POST Request:
curl --user “acc_62606e731a1ac79:03acd65c496f9abf46b0c0ab86c2c13a” -F “image=@/path/to/image.jpg” “https://api.imagga.com/v2/colors”
Example Response:
{
“result”: {
“colors”: {
“background_colors”: [
{
“b”: 47,
“closest_palette_color”: “light bronze”,
“closest_palette_color_html_code”: “#8C5E37”,
“closest_palette_color_parent”: “skin”,
“closest_palette_distance”: 1.70506228322597,
“g”: 92,
“html_code”: “#8C5C2F”,
“percent”: 48.0033950805664,
“r”: 140
},
{
“b”: 146,
“closest_palette_color”: “cerulean”,
“closest_palette_color_html_code”: “#0074A8”,
“closest_palette_color_parent”: “blue”,
“closest_palette_distance”: 5.53350780052479,
“g”: 116,
“html_code”: “#467492”,
“percent”: 39.0454025268555,
“r”: 70
},
{
“b”: 30,
“closest_palette_color”: “dark bronze”,
“closest_palette_color_html_code”: “#542E0C”,
“closest_palette_color_parent”: “skin”,
“closest_palette_distance”: 5.47689735887696,
“g”: 48,
“html_code”: “#4F301E”,
“percent”: 12.9512014389038,
“r”: 79
}
],
“color_percent_threshold”: 1.75,
“color_variance”: 36,
“foreground_colors”: [
{
“b”: 147,
“closest_palette_color”: “larkspur”,
“closest_palette_color_html_code”: “#6E7E99”,
“closest_palette_color_parent”: “blue”,
“closest_palette_distance”: 8.60114706674971,
“g”: 125,
“html_code”: “#577D93”,
“percent”: 52.3429222106934,
“r”: 87
},
{
“b”: 145,
“closest_palette_color”: “pewter”,
“closest_palette_color_html_code”: “#84898C”,
“closest_palette_color_parent”: “grey”,
“closest_palette_distance”: 1.75501013175431,
“g”: 142,
“html_code”: “#898E91”,
“percent”: 30.0293598175049,
“r”: 137
},
{
“b”: 42,
“closest_palette_color”: “brownie”,
“closest_palette_color_html_code”: “#584039”,
“closest_palette_color_parent”: “brown”,
“closest_palette_distance”: 4.99189248709017,
“g”: 58,
“html_code”: “#593A2A”,
“percent”: 17.6277160644531,
“r”: 89
}
],
“image_colors”: [
{
“b”: 146,
“closest_palette_color”: “cerulean”,
“closest_palette_color_html_code”: “#0074A8”,
“closest_palette_color_parent”: “blue”,
“closest_palette_distance”: 7.85085588656478,
“g”: 121,
“html_code”: “#547992”,
“percent”: 48.3686981201172,
“r”: 84
},
{
“b”: 46,
“closest_palette_color”: “light bronze”,
“closest_palette_color_html_code”: “#8C5E37”,
“closest_palette_color_parent”: “skin”,
“closest_palette_distance”: 3.05634270891355,
“g”: 86,
“html_code”: “#83562E”,
“percent”: 47.9353446960449,
“r”: 131
},
{
“b”: 46,
“closest_palette_color”: “navy blue”,
“closest_palette_color_html_code”: “#2B2E43”,
“closest_palette_color_parent”: “navy blue”,
“closest_palette_distance”: 6.62790662069936,
“g”: 27,
“html_code”: “#1F1B2E”,
“percent”: 3.60131478309631,
“r”: 31
}
],
“object_percentage”: 20.790994644165
}
},
“status”: {
“text”: “”,
“type”: “success”
}
}
Analyse and extract the predominant colors from images.
GET https://api.imagga.com/v2/colors
Query Parameters
Parameter Description
image_url Image URL to perform color-extraction on.
image_upload_id You can also directly send image files for color-extraction by uploading them to our /uploads endpoint and then providing the received content identifiers via this parameter.
extract_overall_colors (default: 1) Specify whether the overall image colors should be extracted. The possible values are 1 for 'yes’, and 0 for 'no’.
extract_object_colors (default: 1) Specify if the service should try to extract object and non-object (a.k.a. foreground and background) colors separately. The possible values are 1 for 'yes’, and 0 for 'no’.
overall_count (default: 5) Specify the number of overall image colors the service should try to extract.
separated_count (default: 3) Specify the number of separated colors (foreground and background) the service should try to extract.
deterministic (default: 0) Whether or not to use a deterministic algorithm to extract the colors of the image.
save_index (optional) The index name in which you wish to save this image for searching later on. This parameter require you to also use deterministic algorithm.
save_id (optional) The id with which you wish to associate your image when putting it in a search index. This will be the identificator which will be returned to you when searching for similar images. (If you send an image with an already existing id, it will be overriden as if an update operation took place. Consider this when choosing your ids.) - In order for the image to be present in the search index later on, you need to train it with the /similar-images/colors/<index_id>(/<entry_id>) endpoint
features_type (overall or object) extract color information from foreground object(value: object) or overall image(value: overall) to use for comparison with other photos when using a search index.
Can you please help me write a POST request for Imagga?