Create stunning mosaics from any image using Python! Upload or randomly select an image, adjust resolution, and generate dynamic mosaics from a custom dataset with a user-friendly GUI.
Before you begin, ensure you have the following installed:
- Python 3.9+
- Node.js 16+
- npm or yarn
- (Optional) Kaggle account for dataset access
- Clone the repository:
git clone https://github.com/vmacri7/mosaic-anything.git
cd mosaic-anything- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows, use `venv\Scripts\activate`- Install Python dependencies:
pip install -r requirements.txt-
(Optional but reccomended) Kaggle Dataset Configuration
- Create a Kaggle API token
- Place
kaggle.jsonin~/.kaggle/directory - Set appropriate permissions:
chmod 600 ~/.kaggle/kaggle.jsonSee more (Kaggle API Docs)
-
Install npm packages:
# From project root (mosaic-anything)
npm installcd backend
python -m uvicorn app:app --reload --port 5002# change to project root directory
cd ..
npm run dev- Open the web application in your browser (default:
http://localhost:5174) - Find a dataset to use on kaggle and copy the Kaggle dataset URL
- Paste the URL into the dataset uploader and click "Add Dataset"
- Select datasets from the list once uploaded
- Upload an image or select a random image from the selected dataset
- Configure mosaic parameters:
- Output width (unit: tiles)
- Tile size (unit: pixels)
- Click "Create Mosaic"
- Mosaic artwork will be displayed under Results
- Download your masterpiece! (all mosaics are also saved locally to the
mosaicsfolder)
This project is released under the MIT License.