Image Generator Web App Documentation

1. Introduction

The Image Generator web app is designed to facilitate the generation of images with the same pattern but different colors. Users can upload a single image representing a pattern and another image showcasing various colors for that pattern. The app then processes these images to create new versions with the same pattern but different color schemes. This documentation outlines the key aspects of the project, its functionality, and implementation details.

2. Dependencies

The following external libraries and frameworks are utilized in the project:

- Flask 3.0.1
- Werkzeug 3.0.1
- OpenCV (cv2) 4.9.0.8
- NumPy 1.26.3
- scikit-image 0.22.0
- Bootstrap 4.3.1

3. Getting Started

To run the Image Generator web app locally, follow these instructions:

  1. Create a folder in desktop then run the following command in Terminal or Command Prompt

cd desktop\{Folder Name that you created}
  1. Clone the repository to your local machine:
git clone https://github.com/recursivezero/startup/tree/feature/RZ-240004
  1. Change into the project directory:
cd startup-feature-RZ-240004\startup-feature-RZ-240004\server\Image_generator\scripts
  1. Install the required dependencies:
pip install Flask Werkzeug opencv-python numpy scikit-image
  1. Run the Flask app:
python app.py

The app should now be running locally. Open a web browser and navigate to http://localhost:5000/ to access the Image Generator web app.

4. Features

Image Upload

Users can upload two images - one representing a single pattern and another displaying the same pattern with various colors. The supported image formats include JPG, JPEG, and PNG.

Image Generation

Upon successful upload, users can click the "Generate" button to create new images with the same pattern but different colors. The color variations are extracted from the group image. Thumbnails of the generated images are displayed for the user.

5. Implementation

app.py

The server-side implementation is handled by the Flask web framework. Image processing is done using OpenCV and NumPy. The app provides functionality to find the dominant color of a single pattern image, change the hue of the single pattern image based on colors extracted from the group image, and save the generated images.

The implementation in app.py involves the following key components:

6. Future Enhancements

While the current version of the Image Generator web app successfully changes the hue of the pattern, future enhancements could include:

7. Conclusion

In conclusion, the Image Generator web app successfully addresses the user's requirement of generating images with the same pattern but different colors. The documentation provides an overview of the app's features, dependencies, and implementation. Future enhancements can further improve the app's functionality and user experience.