In this project, we use an ordered dithering method to turn an RGB image, first to a gray scale image and then, turn the gray scale image into a dithered image.
Ordered dithering is an image dithering algorithm. It is commonly used to display a continuous image on a display of smaller color depth. For example, Microsoft Windows uses it in 16-color graphics modes. The algorithm is characterized by noticeable crosshatch patterns in the result. (source)
As mentioned in requirements
file, Numpy and Pillow Libraries are to be installed in order to run this project.
First, create a "test_data" in thr root directory. Then, add two folders in itn named "input" and "output". in the input folder, add any image. to run the code by default, your desired input must be named 1.jpg. (to change this, you may change the values to the filename variable which is hardcoded, making it "Filename.jpg" for example)
After this, you can run RGB2GrayScale
file to get the gray scale image, both shown and also saved in the output folder under the name of "Filename_gs.jpg".
For Dithering, you can run the OrderedDithering
File, give the sliding window size as a console input and get the dithered image both as a shown output and saved as "Filename_d.jpg".
The Original Image:
The GrayScale Image:
The Dithered Image:
Distributed under the MIT License. See LICENSE.md
for more information.
Niki Pourazin - @npourazin - [email protected]
Project Link: https://github.com/npourazin/Ordered-Dithering