This repository contains the resources needed to execute the STEM Project Pixel Tint
Tested on the following hardware
- Hardware: Raspberry Pi 4 Model B
- Operating System: Raspbian Buster Full
The pixelizer folder contains two files, namely, cartoon.py and pokeball.png. cartoon.py is a python script that utilizes on the PILLOW library to convert an image into a pixelized images with its respective greyscale output. An sample image "pokeball.png" has been provided to test out the python script.
Installing Pillow Library (with JPEG Support)
wget http://www.ijg.org/files/jpegsrc.v8c.tar.gz
tar xvfz jpegsrc.v8c.tar.gz
cd jpeg-8c
./configure --enable-shared --prefix=$CONFIGURE_PREFIX
make
sudo make install
sudo ln -s /usr/lib/arm-linux-gnueabi/libjpeg.so /usr/lib
sudo ln -s /usr/lib/arm-linux-gnueabi/libfreetype.so /usr/lib
sudo ln -s /usr/lib/arm-linux-gnueabi/libz.so /usr/lib
sudo apt-get install libjpeg-dev libfreetype6 libfreetype6-dev zlib1g-dev
sudo pip3 install pillow
or
sudo pip3 install pil
sudo apt install imagemagick
The MQTT folder contain the following python file, student_pub.py, where it allows the raspberry pi to publish a MQTT Message to a broker, "gateway pi".
Installation
sudo apt install -y mosquitto-clients
sudo pip3 install paho-mqtt
sudo apt install python3-pip