This program allows you to perform color quantization on images in the JPEG format. Color quantization reduces the number of colors in an image while preserving its visual quality. The main features of this program include:
- Load an image: You can select a JPEG image from your computer to apply color quantization.
- Set the number of clusters: You can specify the number of color clusters to quantize the image.
- Transform the image: Apply color quantization to the loaded image and display the result.
- Download the result: Save the color-quantized image to your computer.
-
Load an Image:
- Click the "Browse" button to select a JPEG image file.
- The selected image will be displayed in the "Original Image" section.
-
Set the Number of Clusters:
- Enter the desired number of color clusters in the "Number of Clusters" field.
- This number determines the level of color quantization.
-
Transform the Image:
- Click the "Transform" button to apply color quantization to the loaded image.
- The color-quantized image will be displayed in the "Color-Quantized Image" section.
- The program uses the K-Means clustering algorithm to reduce the number of colors.
-
Download the Result:
- After transforming the image, click the "Download Result" button.
- Choose a location on your computer to save the color-quantized image.
- Python 3.x
- NumPy
- Matplotlib
- Scikit-learn (for K-Means clustering)
- Tkinter (for the graphical user interface)
- Pillow (PIL) for image handling
-
Make sure you have the required dependencies installed.
-
Run the program by executing the Python script
main.py. -
Follow the on-screen instructions to load an image, set the number of clusters, and transform the image.
-
Download the color-quantized result when you're satisfied with the transformation.
-
Explore the code for customization and further development.
This program was developed by Artem Konotopchyk.
This program is open-source and available for all users.
Feel free to modify, improve, and share this program with others. Happy color quantizing!
