
Analyze Color Composition Across Timelapse Frames
Source:R/create-frame-colors.R
createFrameColors.RdExtracts per-frame color histograms from timelapse replay frames and generates visual color distribution plots. This data powers the color evolution visualization in the artwork replay experience.
Usage
.comp_colors(frame_paths)
.comp_color_plots(color_data, output_dir)
.upload_color_plots(artist, artwork, local_plot_paths)
create_color_dataset(artist, artwork, new_utc = NULL)
create_color_plots(artist, artwork, artwork_colors)Arguments
- frame_paths
Character vector. Local paths to frame PNG files.
- color_data
data.table. Per-frame color histograms with matched colors.
- output_dir
Character. Directory for plot PNG outputs.
- artist
Character. Artist UUID identifying the creator.
- artwork
Character. Artwork UUID for this piece.
- local_plot_paths
Character vector. Paths to plot PNG files.
- new_utc
POSIXct. Timestamp for created_utc field. Defaults to now.
- artwork_colors
data.table. Per-frame color data from create_color_dataset(). Required for create_color_plots().
Value
data.table with columns: frame, hex, N, matched_hex, matched_color
Character vector of local paths to generated plot files
List with success status and CDN paths
data.table with columns: art_uuid, artist_uuid, created_utc, frame, hex, N, and matched color columns. Returns NULL if no frames found.
Details
Color analysis includes: - Extracting hex colors and pixel counts per frame - Matching raw colors to named color codes for grouping - Generating bar chart plots showing color distribution evolution
Functions
.comp_colors(): Pure computation - extract colors from local frames.comp_color_plots(): Pure computation - generate color plot PNGs.upload_color_plots(): I/O only - upload color plots to CDNcreate_color_dataset(): Extract color histograms from CDN frame imagescreate_color_plots(): build colors plots and save to cdn