pix_art is a pixel art photo styling application. It splits the photo into squares according to the set granularity.
Python>=3.8; OpenCV; NumPy
- For Linux, you can probably do it on Windows, too.
- Splits up a photo into squares of the size you want.
- Averages the colors in the squares.
- Saves the processed photo to the default folder, which is automatically created
out_pic
. - Outputs the color of the square on the x, y axes.
- Clone the repository:
https://github.com/Jagernau/pix_art
. - Go to the folder with the application:
pix_art
. - Best of all, create a sandbox for Python:
- If virtualenv fans:
python<version> -m virtualenv env
- Activate the virtual environment:
source env/bin/activate
- If virtualenv fans:
- Install dependencies:
pip install -r requirements.txt
- Create a folder
in_pic
in the program folderpix_art
, put a jpg or png image file in the folder.
To use this program, run the main.py
script in your terminal with the appropriate arguments. The program itself detects the last file added to the default directory in_pic
. You do not need to specify a filename. Here is an example usage: python main.py -g 10 -f image.jpg
.
This will pixelate the image image.jpg
with a grid size of 10 and save the output image to the default output directory, which is out_pic/
.
-g
,--grid_size
: The size of each grid square (in pixels) that the image will be divided into. Default is 10.-f
,--file_name
: The name of the input file to be pixelated. If no file name is provided, the program will pixelate latest image in the input directory.-i
,--input_dir
: The directory where the input images are stored. Default isin_pic/
.-o
,--output_dir
: The directory where the output images will be saved. Default isout_pic/
.
Pixelate all images in the input directory with a grid size of 15: python main.py -g 15
Pixelate the image my_image.png
with a size of 20 and save the output image to a custom output directory: python main.py -g 20 -f my_image.png -o /path/to/output/dir/
I'd be happy to co-develop, even for the sake of learning the great and mighty Git. Who reads this README and has free time and desire to cobble, practice in Git:
- Clone the project repository to your computer:
git clone https://github.com/Jagernau/pix_art
. - Create a separate branch for your work:
git checkout -b <branch name>
. - Make changes to your project code
git add .
and make commits describing the changes you've madegit commit -m "Description of changes you've made"
. 4 Submit your changes to GitHub:git push origin <branch name>
. - Create a pull request on GitHub and wait for the changes to be checked and discussed. That seems to be it.
- Improve the OOP of python.
- To output the color of the squares in HEX.
- And most interestingly, the ability to convert colors in a given palette.
- Make it possible to remove halftones, so that all colors would be localized.
If you have a problem with the project or would like to suggest ideas to improve it, please create a new issue on GitHub. Describe the problem or idea in detail.