Skip to content

Commit a927057

Browse files
Merge pull request #8 from ContextLab/feature/find-missing-posters-issue-6
Add missing posters and border script (Issue #6)
2 parents d32ecc7 + be5fe00 commit a927057

58 files changed

Lines changed: 8270 additions & 191 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,73 @@ The test suite (`tests/test_build_cv.py`) includes 61 tests covering:
429429
1. Add screenshot to `images/software/`
430430
2. Edit `software.html`, add to software grid
431431

432+
## Adding Hand-Drawn Borders to Images
433+
434+
Poster thumbnails and people photos use hand-drawn green borders for visual consistency. Use the `add_poster_borders.py` script to add these borders to new images.
435+
436+
### Border Script Usage
437+
438+
```bash
439+
# Basic usage
440+
python scripts/add_poster_borders.py <input_dir> <output_dir>
441+
442+
# Example: Process new poster images
443+
python scripts/add_poster_borders.py images/publications/new/ images/publications/
444+
445+
# Example: Process a single image (copy to temp folder first)
446+
mkdir temp_input
447+
cp images/publications/MyPoster.png temp_input/
448+
python scripts/add_poster_borders.py temp_input/ temp_output/
449+
mv temp_output/MyPoster.png images/publications/MyPoster.png
450+
rm -rf temp_input temp_output
451+
```
452+
453+
### How It Works
454+
455+
The script:
456+
1. Loads 10 hand-drawn border designs from `images/templates/WebsiteDoodles_Posters_v1.svg`
457+
2. For each input PNG, selects a random border
458+
3. Resizes the image to fit inside the border frame (poster extends to middle of border lines)
459+
4. Composites the border on top of the image
460+
5. Makes areas outside the border transparent
461+
6. Outputs a 500x500 PNG with ~41px transparent margins
462+
463+
### Adding New Poster Thumbnails
464+
465+
1. Create a thumbnail PNG of the poster (any size, will be resized)
466+
2. Place in a temporary input folder
467+
3. Run the border script
468+
4. Move the output to `images/publications/`
469+
5. Update `data/publications.xlsx` with the image filename
470+
471+
### Adding New People Photos
472+
473+
1. Prepare the photo as a PNG (square crop recommended)
474+
2. Place in a temporary input folder
475+
3. Run the border script
476+
4. Move the output to `images/people/`
477+
5. Update `data/people.xlsx` with the image filename
478+
479+
### Script Options
480+
481+
```bash
482+
python scripts/add_poster_borders.py --help
483+
484+
Options:
485+
input_dir Directory containing input PNG files
486+
output_dir Directory to save output files
487+
--border-svg Path to SVG with border designs (default: images/templates/WebsiteDoodles_Posters_v1.svg)
488+
--output-size Output image size in pixels (default: 500)
489+
```
490+
491+
### Requirements
492+
493+
The script requires:
494+
- Python 3
495+
- PIL/Pillow
496+
- NumPy
497+
- `rsvg-convert` (from librsvg, install via `brew install librsvg` on macOS)
498+
432499
## Mobile Responsiveness
433500

434501
The site is fully responsive with breakpoints at:

0 commit comments

Comments
 (0)