Skip to contents

Parses a screenshot of Procreate's statistics panel using OCR to extract brush stroke count and drawing time. These metrics are core inputs for the 15-metric benchmark system and displayed on artwork pages.

Usage

.comp_stats(img_path)

extract_stats_procreate(artist, artwork, fp = NULL, new_utc = NULL)

Arguments

img_path

Character. Local path to stats screenshot image.

artist

Character. Artist UUID identifying the creator.

artwork

Character. Artwork UUID for this piece.

fp

Character. Optional local file path to the stats screenshot. If NULL (default), retrieves stats.jpeg from CDN vault.

new_utc

POSIXct. Timestamp for database records. If NULL, uses current time.

Value

data.table with extracted and derived statistics: - `brush_strokes`: Total strokes from OCR - `tracked_time`: Raw time string (e.g., "8h 30m") - `drawing_hours`: Integer hours component - `drawing_minutes`: Total minutes (hours*60 + minutes) - `ave_bpm`: Average brush strokes per minute - `artist_uuid`, `art_uuid`, `created_utc`: Identifiers

List with brush_strokes, tracked_time, drawing_hours, drawing_minutes, ave_bpm

Details

Procreate tracks "Total Strokes Made" and "Tracked Time" internally but doesn't expose them via an API. Artists capture a screenshot of the stats panel, and this function uses OCR to extract the values programmatically.

## OCR Patterns The function searches for patterns like: - "total strokes made 3,070" or "total strokes made 3070" - "tracked time 8h 30m" or "tracked time 8h"

The screenshot should be a clear capture of Procreate's Statistics panel. Low resolution or cropped images may cause OCR failures.

Functions

  • .comp_stats(): Pure computation - OCR and parse stats from image

  • extract_stats_procreate(): Parse stats screenshot via OCR

Error Handling

Throws descriptive errors if OCR fails to extract required values. Common causes: blurry screenshots, incorrect file, or unusual formatting.