Skip to content

Instantly share code, notes, and snippets.

View symisc's full-sized avatar

PixLab | Symisc Systems symisc

View GitHub Profile
@symisc
symisc / uae_emirates_id_card_scan.py
Last active October 14, 2021 02:10
Scan an UAE (United Arab Emirates) ID card via the PixLab docscan API endpoint (Python code sample). Extract the holder's face and display all fields - https://pixlab.io/cmd?id=docscan
import requests
import json
# Given a government issued ID card from the UAE (emirates). Extract the holder's face and d aisplay all scanned fields.
#
# PixLab recommend that you connect your AWS S3 bucket via your dashboard at https://console.pixlab.io/
# so that any cropped face or MRZ crop is stored automatically on your S3 bucket rather than the PixLab one.
# This feature should give you full control over your analyzed media files.
#
# https://pixlab.io/cmd?id=docscan&&country=uae for additional information.
@symisc
symisc / uae_emirates_id_card_scan.php
Last active October 14, 2021 01:53
Scan an UAE (United Arab Emirates) ID card via the PixLab docscan API endpoint (PHP code sample). Extract the holder's face and display all fields - https://pixlab.io/cmd?id=docscan
<?php
/*
* Usage sample of the UAE ID card scanner API endpoint from PixLab - https://pixlab.io/cmd?id=docscan.
*/
/*
* 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";
# Given a government issued ID card from the UAE (emirates). Extract the holder's face and display all scanned fields.
@symisc
symisc / pixlab_random_pixelgenerate.php
Last active September 21, 2021 01:52
Dynamically generates a set of random pixels of desired width & height using PixLab /pixelgenerate API endpoint - https://pixlab.io/cmd?id=pixelgenerate
<?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";
# Generates a set of random pixels of desired Width & Height.
# This endpoint is similar to the /newimage endpoint except that the image contents is filled with random pixels.
# This is very useful for generating background (negative) samples for feeding Machine Learning training algorithms.
@symisc
symisc / generate_meme.py
Last active April 14, 2022 23:53
Draw some funny text on top & button of the famous Michael Jordan crying face using the PixLab API - https://pixlab.io/cmd?id=drawtext
import requests
import json
# Draw some funny text on TOP & BOTTOM of the famous Cool Cat public domain image.
# https://pixlab.io/cmd?id=drawtext is the target endpoint for drawing text on images
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 August 12, 2021 01:03
Draw some funny text on top & button of the famous Michael Jordan crying face using the PixLab API - https://pixlab.io/cmd?id=drawtext
<?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 & BOTTOM 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 April 3, 2021 00:45
Encrypt an Image to Enciphered Pixels using the PixLab API - https://pixlab.io/cmd?id=encrypt
<?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 April 3, 2021 00:31
Encrypt an Image to Enciphered Pixels using the PixLab API - https://pixlab.io/cmd?id=encrypt
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 March 31, 2021 01:28
Composite two or more images on top of another using the PixLab API - https://pixlab.io/cmd?id=merge
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 March 31, 2021 01:26
Composite two or more images on top of another using the PixLab API - https://pixlab.io/cmd?id=merge
<?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 March 31, 2021 01:24
Convert a given image to the grayscale color space using the PixLab API - https://pixlab.io/cmd?id=grayscale
<?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.
*/