5 Commits

Author SHA1 Message Date
bankosegger
b8c4ada06a feat: frame the photo with Christmas trees, presents and ornaments
Trees with stars, presents and falling snow stand on a line of snow above
the photo; baubles, stars, bells and snowflakes hang below it. Pixels
shrink to 6 dots so the motifs are recognisable at the same height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-18 17:53:45 +01:00
bankosegger
34f5914bb1 feat: draw snowy fir trees above the photo and icicles below it
Replaces the random pixel noise with Christmas scenery: snow next to the
photo, small trees and flakes on top, icicles hanging underneath.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-18 17:48:16 +01:00
bankosegger
4a3149bab3 feat: frame the photo with pixel strips above and below
The solid line of each strip sits next to the photo and the pixels thin
out away from it; the strip at the bottom of the slip is gone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-18 17:44:46 +01:00
bankosegger
67aa0e64c1 feat: replace the sprite with a full-width pixel strip that thins out
The strip is four lines of 12-dot pixels across the paper: the first line
is solid and each line below it has fewer pixels in random places.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-18 17:43:06 +01:00
bankosegger
16993e8231 feat: print a small random pixel-art sprite at the bottom of each slip
A mirrored 8x4 cell sprite, 72 dots high on 80 mm paper, is printed
centred below the quote and differs per copy.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-18 17:38:34 +01:00
2 changed files with 7 additions and 7 deletions

4
.env
View File

@@ -11,8 +11,8 @@ PHOTOBOOTH_PRINTER=/dev/usb/lp0
PHOTOBOOTH_PRINTER_DOTS=576
# Mid-tone brightening before dithering, offsetting thermal dot gain
# (1.8-3.0 is typical; 1 disables it).
PHOTOBOOTH_PRINTER_GAMMA=2.7
# (1.8-2.5 is typical; 1 disables it).
PHOTOBOOTH_PRINTER_GAMMA=2.0
# Head energy in percent of rated (70-130) and print speed: quality (120 mm/s),
# low (150), silent (180) or high (200). Both are SII RP-D10 commands (DC2 ~

View File

@@ -10,7 +10,7 @@
//! of 8. Defaults to 576 (80 mm paper); use 384 for 58 mm paper.
//! - `PHOTOBOOTH_PRINTER_GAMMA`: mid-tone brightening applied before dithering
//! to offset the dot gain of thermal paper (`out = in^(1/gamma)`). Defaults to
//! 2.7; typical values are 1.8-3.0, and 1 disables it.
//! 2.0; typical values are 1.8-2.5, and 1 disables it.
//! - `PHOTOBOOTH_PRINTER_DENSITY`: thermal head energy in percent of the rated
//! energy, 70-130 (SII `DC2 ~ n`). Unset by default.
//! - `PHOTOBOOTH_PRINTER_SPEED`: `quality` (120 mm/s), `low` (150 mm/s),
@@ -62,7 +62,7 @@ use crate::{
const DEFAULT_PRINTER: &str = "/dev/usb/lp0";
const DEFAULT_DOTS: usize = 576;
const DEFAULT_GAMMA: f32 = 2.7;
const DEFAULT_GAMMA: f32 = 2.0;
const DENSITY_RANGE: std::ops::RangeInclusive<u8> = 70..=130;
/// CLAHE settings: contrast limit and tiles across the image.
const CLAHE_CLIP_LIMIT: f64 = 2.0;
@@ -603,7 +603,7 @@ mod tests {
let printer = Printer::from_values(None, None, None).unwrap();
assert_eq!(printer.target, Target::Device("/dev/usb/lp0".into()));
assert_eq!(printer.dots, 576);
assert_eq!(printer.gamma, 2.7);
assert_eq!(printer.gamma, 2.0);
// Unparsable widths fall back; valid ones are rounded to whole bytes.
let dots = |value| Printer::from_values(None, Some(value), None).unwrap().dots;
assert_eq!(dots("wide"), 576);
@@ -611,8 +611,8 @@ mod tests {
// Gamma must be a positive number.
let gamma = |value| Printer::from_values(None, None, Some(value)).unwrap().gamma;
assert_eq!(gamma(" 2.4 "), 2.4);
assert_eq!(gamma("0"), 2.7);
assert_eq!(gamma("bright"), 2.7);
assert_eq!(gamma("0"), 2.0);
assert_eq!(gamma("bright"), 2.0);
// An explicitly empty printer disables printing.
assert!(Printer::from_values(Some(""), None, None).is_none());
}