feat(photos): a photo knows its colours and its calm areas

Photo signals move to version 3: a deterministic palette, a busy grid and
the point of most detail, stored as measured values, never as image bytes.
This commit is contained in:
Maurice
2026-10-22 21:25:46 +00:00
parent 4570ace78c
commit 2c98ae8e4a
10 changed files with 398 additions and 8 deletions
@@ -0,0 +1,20 @@
import { Migration } from '@mikro-orm/migrations';
/**
* What else a photo's pixels say, for the assistant's book design: its main
* colours (`palette`, JSON of up to five `"#rrggbb:share"`), where it is busy
* and where calm (`busy`, an 8 x 8 grid of edge density, one hex digit per
* cell, row by row) and where its detail gathers (`sal_x`, `sal_y`, 0 to 1 of
* each side; an estimate, no face detection). Measured with the rest of the
* signals; a row of an older measurement is measured again.
*/
export class Migration20200101046270_a_photo_knows_its_colours_and_calm_areas extends Migration {
override name = 'Migration20200101046270_a_photo_knows_its_colours_and_calm_areas';
override up(): void {
this.addSql('ALTER TABLE trek_photo_signals ADD COLUMN palette TEXT');
this.addSql('ALTER TABLE trek_photo_signals ADD COLUMN busy TEXT');
this.addSql('ALTER TABLE trek_photo_signals ADD COLUMN sal_x REAL');
this.addSql('ALTER TABLE trek_photo_signals ADD COLUMN sal_y REAL');
}
}