This project generates a custom wallpaper for your lock screen that matches the appearance of your password screen. It consists of four Python scripts and a configuration file.
- Python 3 or higher
- Pillow library
Install the required library using:
pip install pillow
-
Replace the images in the input folder with your own images. Make sure to name them correctly:
source/original.jpg
: The source image you want to use as a wallpaper.lockscreen/lockscreen.png
: A screenshot of your lock screen without the password prompt.lockscreen/password.png
: A screenshot of your lock screen with the password prompt visible.
-
Run the following scripts in order:
- Generate the calibration pattern
python generate_pattern.py
- Replace your lock screen wallpaper with the generated image. Default location:
backgrounds/background_pattern.jpg
- Replace your profile picture with the black image. Default location:
backgrounds/black.jpg
- Take a screenshot of your lock screen. The plain and with password prompt. Save them as
lockscreen/lockscreen.png
andlockscreen/password.png
respectively.- To take screenshots, you can use snipping tool on
Windows
. Set it asRectagle mode
then add some delay. - Then click new and lock your screen.
- To take screenshots, you can use snipping tool on
- Replace your lock screen wallpaper with the generated image. Default location:
- Calculate the difference between the lock screen and the password prompt
If your windows doesn't have Zoom effect, you can skip this step.
This will calculate the difference between the lock screen and the password prompt.
python diff.py
- Generate the profile image
Let the magic happen. This will generate the profile image.
python generate_profile.py
--tint TINT
: Tint percentage (float) to apply (default: 0)--auto-tint:
Automatically detect tint percentage from the source image--sample-area X1 Y1 X2 Y2
: Sample area for automatic tint detection (default: 200, 200, 400, 400). Provide 4 integers as coordinates.--mask
: Create a mask from the lock screen image--circle
: Create a mask as a circle from the lock screen image--scale SCALE
: Increase or decrease the size of the mask scale percentage (default: 100)
- Generate the calibration pattern
-
The generated profile will be saved in
result/result.jpg
. Apply this image as your lock screen wallpaper. -
During the process, there are additional images created :
backgrounds/pattern_lock_screen.png
: A patterned image that mimics the border design of the lock screen.source/cropped.jpg
: The cropped source image.source/resized.jpg
: The resized source image.
You can customize the input and output paths of your project in the config.json file. Modify the paths as needed.
{
"input": {
"source": "source/original.jpg",
"lockscreen": "lockscreen/lockscreen.png",
"password": "lockscreen/password.png"
},
"output": {
"pattern": "backgrounds/pattern_lock_screen.png",
"result": "result/result.jpg",
"source_cropped": "source/cropped.jpg",
"source_resized": "source/resized.jpg"
}
}
generate_pattern.py
: This script creates a reference pattern image based on the source image dimensions.diff.py
: This script finds the differences between the lock screen and password screen images and resizes the source image accordingly.generate_profile.py
: This script creates a mask from the lock screen password image and applies it to the resized source image to generate the final wallpaper.
This project is licensed under the MIT License. See the LICENSE
file for more information.