A simple Python script that enlarges an image by 2x using pixel-based HSL color variations.
This project uses Pillow and Python’s colorsys module to read an image, with each pixel, and create a new image that is twice the size of the original.
Instead of copying pixels directly, it ‘hopefully’ will create 4 different pizels of similar colors for each pixel and places them in a 2x2 block.
output.png.Run the script and enter the full path to your image when prompted:
You have to put your image in the same folder as the code for it to work
Example input:
Enter the full path to your image: C:\Users\YourName\Pictures\photo.png
The script will create an enlarged version of the image in the same folder as the original and save it as:
output.png
For each pixel in the original image, the script:
input(), so it must be run in an interactive terminal.new_img.show() call may not work in all environments.