Skip to content

Instantly share code, notes, and snippets.

Avatar

PixLab | Symisc Systems symisc

View GitHub Profile
@symisc
symisc / generate_meme.py
Created Apr 3, 2021
Draw some funny text on top & button of the famous Michael Jordan crying face using the PixLab API - https://pixlab.io/cmd?id=drawtext
View generate_meme.py
import requests
import json
# Draw some funny text on top & button of the famous Michael Jordan crying face.
# https://pixlab.io/cmd?id=drawtext is the target endpoint for drawing text on imges
req = requests.get('https://api.pixlab.io/drawtext',params={
'img': 'https://pixlab.io/images/jdr.jpg',
'top': 'someone bumps the table',
'bottom':'right before you win',
'cap':True, # Capitalize text,
'strokecolor': 'black',
@symisc
symisc / generate_meme.php
Last active Apr 3, 2021
Draw some funny text on top & button of the famous Michael Jordan crying face using the PixLab API - https://pixlab.io/cmd?id=drawtext
View generate_meme.php
<?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";
# Draw some funny text on top & button of the famous Michael Jordan crying face.
# https://pixlab.io/cmd?id=drawtext is the target endpoint for drawing text
@symisc
symisc / encrypt_image.php
Created Apr 3, 2021
Encrypt an Image to Enciphered Pixels using the PixLab API - https://pixlab.io/cmd?id=encrypt
View encrypt_image.php
<?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";
# Converts plain pixels of a given image to enciphered pixels. The image is not readable until it has been deciphered using decrypt.
# https://pixlab.io/cmd?id=encrypt && https://pixlab.io/cmd?id=decrypt
@symisc
symisc / encrypt_image.py
Created Apr 3, 2021
Encrypt an Image to Enciphered Pixels using the PixLab API - https://pixlab.io/cmd?id=encrypt
View encrypt_image.py
import requests
import json
# Converts plain pixels of a given image to enciphered pixels. The image is not readable until it has been deciphered using decrypt.
# https://pixlab.io/cmd?id=encrypt && https://pixlab.io/cmd?id=decrypt
# Target image to enrypt
img = 'https://pixlab.io/images/bencrypt.png'
# Password used for decryption
pwd = 'superpass'
@symisc
symisc / image_composite.py
Created Mar 31, 2021
Composite two or more images on top of another using the PixLab API - https://pixlab.io/cmd?id=merge
View image_composite.py
import requests
import json
# 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.
req = requests.post('https://api.pixlab.io/merge',
headers={'Content-Type':'application/json'},
data=json.dumps({
@symisc
symisc / image_composite.php
Created Mar 31, 2021
Composite two or more images on top of another using the PixLab API - https://pixlab.io/cmd?id=merge
View image_composite.php
<?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.
@symisc
symisc / grayscale.php
Last active Mar 31, 2021
Convert a given image to the grayscale color space using the PixLab API - https://pixlab.io/cmd?id=grayscale
View grayscale.php
<?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.
*/
@symisc
symisc / grayscale.py
Created Mar 31, 2021
Convert a given image to the grayscale color space using the PixLab API - https://pixlab.io/cmd?id=grayscale
View grayscale.py
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',
@symisc
symisc / smart_media_validation.py
Created Mar 31, 2021
Check if a given image is of the right dimension and if not try to resize it using the PixLab API - https://pixlab.io/cmd?id=smartresize
View smart_media_validation.py
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
@symisc
symisc / smart_media_validation.php
Created Mar 30, 2021
Check if a given image is of the right dimension and if not try to resize it using the PixLab API - https://pixlab.io/cmd?id=smartresize
View smart_media_validation.php
<?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