This project is intended to produce images composed of 16x16 pixel clusters of space images mostly from by Hubble Space Telescope. The algorithm is written in Python. The app web runs with streamlit. You can try it at: https://pic2appble-hvlheiu8rexwewpebevkvr.streamlit.app/
Note: If the web app brings you to a forked repo (it will be keep synced), the original is: https://github.com/Wolfteinter/Pic2Hubble, so give us a star ⭐ there if you did like the project.
- Save as a CSV file the average color per channel of all the images of the dataset.
- Import the data from the CSV into a Pandas DataFrame.
- Iterate over the input image with a slicing window of 16x16, calculate the average color per channel in the window and find the
the element k nearset in DataFrame.
- Select a random image from the k images.
- Replace the window using the choosen astro mini photo.
- Save the average color of all the images in the dataset and save them in a CSV file.
- Import the data from the CSV into a Pandas DataFrame.
- Graph is generated, from color interval (0, 0, 0) to (step, step, step), where the step can be [3, 5, 15, 17, 51, 85], and then for each color channel, the interval is increased with by step value and the same process is continued for each color interval until the color reaches (255, 255, 255) and for each color interval a search is performed to find the 3 closest images based on the mean color over the Dataframe.
- Iterate over the input image with a slicing window of 16x16, calculate the average color per channel in the window and then search the replacing image on the graph using DFS.
- Select a random image from the images available.
- Replace the slice for the image.
Requeriments
Create virtual environment and install Python dependencies
make setup
make run
A tab will be open in the browser with the app running.
Feel free to open/help with issues. Fork the repo, create a branch from main
branch, work your changes and open a Pull Request.