Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.
/ pix2circ Public archive

A software which will try to compress an image to a list of circles. School assignment.

License

Notifications You must be signed in to change notification settings

ubergard/pix2circ

Repository files navigation

Pix2Circ - Tutorial for dummies

It will create an approximation of a picture/file by a set of superimposed or imposed circles.
There are multiple algorithms implemented and some benchmark tools.

Steps to run our code:

Change directory to our pix2circ directory and build it by using make:

cd pix2circ/
make 

We have 3 working algorithms you can choose from. We have assigned numbers to chose which algorithm you want to use. We have prepared two binary images, the batman logo and the kfc logo, converted them into 0's and 1's and exported them to a .txt file. Namely batman.txt and kfc.txt, the batman logo is a bit small, the results are shown better with the kfc image.

Bogo place :1
Directed random place :2
Bogo feedback :3

The different algorithms work in different ways, for Bogo place and the placeholder name algorithms, you have to assign how many circles you want to run with. For the modified bogo place, you assign the accuracy that you want it to run with, with a number between 1-99, the higher the number, the better accuracy you will get. After you have run the program, it will generate a .png image in the pix2circ folder.

Example for running Bogo place:

./pix2circ kfc.txt 1 500

This will run the bogo place algorithm, on the kfc image, with 500 circles.

Example for running Directed random place:

./pix2circ batman.txt 2 1000

This will run the directed random place algorithm, on the batman logo, with 1000 circles.

Example for running Bogo feedback:

./pix2circ kfc.txt 3 99

This will run the bogo feedback algorithm, on the kfc image, with 99% accuracy.

Documentation and dependencies

The work is documented using Sphinx, it is required that Sphinx is set up to view the documentation. This was taught to us in a previous INF course, namely INF200 as a valid way of providing documentation.

Setting up Sphinx

for Linux users, you can install it by writing the following command in the terminal:

apt-get install python3-sphinx

For more information regarding sphinx or if you use other distributions, please read the installation guide underneath: https://www.sphinx-doc.org/en/master/usage/installation.html

Setting up Read the docs theme The built-in themes didn't do it for us, so we need to install "Read the docs" sphinx theme. this can be done by typing in 1 out of these 2 options in the terminal:

pip install sphinx_rtd_theme

OR

pip3 install sphinx sphinx_rtd_theme

For more information regarding this theme, or using other distributions: https://sphinx-rtd-theme.readthedocs.io/en/stable/installing.html

IF by any chance you as the viewer do not wish to install this theme, and not view it in its best form, you have to open the conf.py file, and change line number 39 from:

html_theme = 'sphinx_rtd_theme'

TO

html_theme = 'sphinxdoc'

When these steps are done, change directory to the docs directory and build the documentation, followed by changing directory to html via the _build directory and open the index.html file.

cd docs/ 
make html
cd _build/html

As an alternative we have added a PDF file aswell that can be viewed, however, we must add this does not reflect the documentation in its best form as it is an autogenerated file by the help of make latexpdf. This should be considered a last resort alternative as for viewing goes.

About

A software which will try to compress an image to a list of circles. School assignment.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published