This project is a tool for creating hybrid images. These are optical illusions that combine two images where one image is only visible up close, with the other emerging when viewed from a distance.
- Clone the repository
git clone https://github.com/simran-ss-sandhu/Hybrid-Image-Generator.git
- Navigate to the project directory
cd Hybrid-Image-Generator
- Set up a virtual environment (optional but recommended)
- Windows
python -m venv venv && venv\Scripts\activate
- UNIX (Linux, MacOS, etc.)
python -m venv venv && source venv/bin/activate
- Windows
- Install dependencies
pip install -r requirements.txt
To create a hybrid image, run the following command in the project directory:
python src/main.py --i <near_image_path> <far_image_path> --o <output_image_path> [--s <low_sigma> <high_sigma>] [--v]
--i
,--input
: Required- Type:
str
- Specifies the paths to the 2 input images. These images will be used to generate the hybrid image.
- The 1st image becomes clearer as you closer
- The 2nd image becomes clearer as you move further away
- Example:
--input data/happy.png data/sad.png
- Type:
--o
,--output
: Required- Type:
str
- Specifies the path to save the generated hybrid image.
- Example:
--output output.png
- Type:
--s
,--sigma
: Optional- Type:
int
- Specifies the integer sigma values for the filters:
- 1st value is for the Low-pass filter
- 2nd value is for the High-pass filter
- Example:
--sigma 6 17
- If not provided, default values are used.
- Type:
--v
,--visualiser
: Optional- Opens a window to visually showcase the hybrid image effect.