This is a Typst/Python/Bash project that makes creation of a face book fast and easy.
It was originally created for the French engineering school INSA Rennes, but can easily be adapted to every school in the world.
- Place in the
/raw
directory all the raw image files, following theDepartment/Year/Group
hierarchy. They must be in the format.JPG
. - Also place the
.xlsx
files in the same hierarchy. - Put the wanted background image in the
trombinoclean
directory, under the namebg_big.jpg
. - Launch the
/convert-raw.sh
script. This will :- Read pictures in
/raw
that have not already been converted - Convert the green screen to the background image
- Detect the faces in those pictures
- Crop around those faces, or around a center point if the face detection has failed
- Resize the pictures to a much lower size (270 in width and keeping the same ratio, customizable)
- Save the edited picture in
/data
in the.JPG
format - Remove all previously existing
.csv
files in/data
- Convert all
.xlsx
files (Google Sheets export / Excel files) from/raw
to.csv
ones in/data
- yes, this step will take a long time and will burn your computer
- Read pictures in
- Put the
GroupsData.csv
file in/data
. - Do
typst compile trombi.typ
. - Ta-dam!
- Images should have the same dimensions as the background image (in 2024, 4000x6000).
- They can be rotated if and only if the file contains the necessary EXIF attributes to make the scripts understand their orientation (i.e., if you open the file with an image viewer, it is automatically in the right orientation).
- Images should have the
.JPG
format (case-sensitive). - They are automatically cropped around detected face with customizable percentages. They are also resized to a smaller size (in 2024, 270x303).
- Those peculiarities can be changed in the
replacehsv.py
Python script.