Texture synthesis is a technique of generating new images by stitching together patches of existing images. The purpose of study is to understand patched based method for generating arbitrarily large textures from small real-world samples. The study is implementation of the paper Image Quilting for Texture Synthesis and Transfer, based on the work of Alexei Efros and William Freeman.
- numpy
- skimage
- PIL
- argparse
- pyqt5 (For GUI Implementation)
Using Command Line :
- You will first have to download the repository and then extract the contents into a folder.
- Make sure you have the correct version of Python installed on your machine. This code runs on Python 3.6 above.
- Install all dependencies mentioned above.
- You can open the folder and run texture_synthesis.py on command prompt.
python texture_synthesis.py --image_path <image_path> --block_size <int_value> --num_block <int_value> --mode <Random/Best/Cut>
For example :
python texture_synthesis.py --image_path data/input1.jpg --block_size 60 --num_block 8 --mode Best
The default values of block_size is 50, num_block is 6 and mode is "Cut".
Using GUI :
- Go to Texture_Synthesis_GUI folder, and run
Texture_Synthesis_GUI.py
- The above file will open GUI then you can run it.
The default values of block_size is 50, num_block is 6 and mode is "Cut" and can not be changed.
Note : For more details of texture synthesis using patch based method, go through Texture Synthesis : Generating arbitrarily large textures from image patches.