Some simple implementation using OpenCV in python
$ pip install numpy
$ pip install matplotlib
$ pip pip install opencv-pythonk-means wiki k-means pyimagesearch
To achieve this the scikit-learn library is used Five clusters are used and so we find how much percent of color are there in the 5 most used colors in the bar.
An image(grayscale) is splitted into n number of images by iterating over the rows and columns of the original image and randomly copying the pixel value to any of the n images.
This example producaes a random key of the same shape as image and XOR it with the input image to encrpyt.
Then to decrpt the key is XORed with the encrypted image.

Read this blog for details about using filters in fourier domain in Image Processing.
A high pass filter is used to detect the edges in an grayscale image.


