This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github | |
* https://github.com/symisc/pixlab-php | |
*/ | |
require_once "pixlab.php"; | |
# Detect all human faces present in a given image and try to guess their age, gender and emotion state via their facial shapes. | |
# https://pixlab.io/#/cmd?id=facemotion for more info. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github | |
* https://github.com/symisc/pixlab-php | |
*/ | |
require_once "pixlab.php"; | |
# Composite a static image on top of a GIF. | |
# If you want to composite multiple images, then use the `merge` command instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Composite a static image on top of a GIF. | |
# If you want to composite multiple images, then use the `merge` command instead. | |
import requests | |
import json | |
# https://pixlab.io/cmd?id=gifcomposite | |
gif = 'http://i.stack.imgur.com/h8Hjm.gif' | |
# Static images to be displayed starting from frame 5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
# Dynamically create a 300x300 PNG image with a yellow background and draw some text at the center of it later. | |
# Refer to https://pixlab.io/cmd?id=newimage && https://pixlab.io/cmd?id=drawtext for additional information. | |
req = requests.get('https://api.pixlab.io/newimage',params={ | |
'key':'PIXLAB_API_KEY', # Your PixLab API Key - Get yours from https://pixlab.io/dashboard | |
"width":300, | |
"height":300, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github | |
* https://github.com/symisc/pixlab-php | |
*/ | |
require_once "pixlab.php"; | |
# Dynamically create a 300x300 PNG image with a yellow background and draw some text on top of it later. | |
# Refer to https://pixlab.io/cmd?id=newimage && https://pixlab.io/cmd?id=drawtext for additional information. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github | |
* https://github.com/symisc/pixlab-php | |
*/ | |
require_once "pixlab.php"; | |
# Check if a given image is of the right size: 800x600 and if not try to resize it. | |
# The command of interest here are header: https://pixlab.io/cmd?id=header & smartresize: https://pixlab.io/cmd?id=smartresize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
# Check if a given image is of the right size: 800x600 and if not try to resize it. | |
# The command of interest here are header: https://pixlab.io/#/cmd?id=header & smartresize: https://pixlab.io/#/cmd?id=smartresize | |
img = 'https://s-media-cache-ak0.pinimg.com/736x/60/aa/e4/60aae45858ab6ce9dc5b33cc2e69baf7.jpg' | |
key = 'PIXLAB_API_KEY' # Your PixLab API Key - Get yours from https://pixlab.io/dashboard | |
# Obtain image metadata at first via header |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
# Convert a given image to the grayscale color space. A grayscale (or graylevel) image is simply one in which the only colors are shades of gray. | |
# https://pixlab.io/cmd?id=grayscale for additional information. | |
req = requests.get( | |
'https://api.pixlab.io/grayscale', | |
params={ | |
'img':'https://www.allaboutbirds.org/guide/PHOTO/LARGE/blue_jay_8.jpg', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github | |
* https://github.com/symisc/pixlab-php | |
*/ | |
require_once "pixlab.php"; | |
/* | |
* Convert a given image to gray color model. A grayscale (or graylevel) image is simply one in which the only colors are shades of gray. | |
* https://pixlab.io/cmd?id=grayscale for additional information. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* PixLab PHP Client which is just a single class PHP file without any dependency that you can get from Github | |
* https://github.com/symisc/pixlab-php | |
*/ | |
require_once "pixlab.php"; | |
/* | |
* Composite two smiley on top of the famous Michael jordan crying face. | |
* A more sophisticated approach would be to extract the facial landmarks coordinates using /facelandmarks and composite something on the different regions. | |
* https://pixlab.io/cmd?id=merge for more info. |