Send Get request to API with src url of a logo image as attribute to get 2 color values:
- Border color of image
- Primary logo color
Clone the repo on your device and install the dependencies:
$ git clone https://github.com/Intact01/Python-REST-API.git
$ cd Python-REST-API
$ pip install -r requirements.txt
NOTE: Make sure you have python3 and pip installed. If not then first install them from apt and then try installing dependencies.
Now run the api server:
$ python3 main.py
Send get request to server by sending image url as src attribute.
$ curl http://127.0.0.1:5000?src=<image_url>
Replace <image_url> by your logo image URL.
$ curl http://127.0.0.1:5000?src=https://storage.googleapis.com/bizupimg/profile_photo/WhatsApp%20Image%202020-08-23%20at%203.11.46%20PM%20-%20Himanshu%20Kohli.jpeg
{
"logo_border": "#98FC03",
"dominant_color": "#040505"
}
$ curl http://127.0.0.1:5000?src=https://storage.googleapis.com/bizupimg/profile_photo/918527129869%20instagram-logo-png-2451.png
{
"logo_border": "#000000",
"dominant_color": "#000000"
}
$ curl http://127.0.0.1:5000?src=https://storage.googleapis.com/bizupimg/profile_photo/bhawya_logo.jpeg
{
"logo_border": "#9AC431",
"dominant_color": "#C5031A"
}
$ curl http://127.0.0.1:5000?src=https://storage.googleapis.com/bizupimg/profile_photo/kppl_logo.png
{
"logo_border": "#05023E",
"dominant_color": "#03023B"
}