A Python program to test fax machine algorithm from csunplugged's Image Representation activity.
The program takes input in the form of a text file and uses the coded algorithm to draw the design.
- Clone or fork this project
git clone https://github.com/HundredVisionsGuy/faxmachininator.git
. - Download
poetry
from python-poetry.org - Make sure you have VSCode downloaded (or use your favorite text editor)
- Open
generator.code-workspace
- Install the Python extension for Visual Studio Code.
- In the terminal, type:
poetry install
poetry shell
- Open Command Palette by either...
CTRL
+Shift
+P
OR- View > Command Palette
- From Command palette,
- choose Python: Select Interpreter
- Look for an interpreter path with
Poetry
(in blue) on the far right. - Select that path.
- If you don't see it, click the little refresh icon at the top (to the right of "Select Interpreter")
- Place your image code as text files in the appropriate folder:
- Using the Black and White Algorithm? put it in the
data/black_and_white
folder (usebw_image_template.txt
as a guide) - Using the Color Algorithm? put it in the
data/color_projects
folder (usecolor_image_template.txt
as a guide)
- Using the Black and White Algorithm? put it in the
- Write the algorithm in a text file where each line is a row of pixels
- Store the file in the
data
folder (data/filename.txt
). - Run main:
python main.py