Skip to contents

What is artpixeltrace?

artpixeltrace provides certificate generation and image verification for digital artwork authenticity within the Artalytics platform. It enables: - Certificate of Authenticity - Generate professionally designed PDF certificates for verified artworks - Perceptual Hashing - Compute image fingerprints for duplicate detection and verification - Canvas Inspection - Validate Procreate files contain artist signatures

Package Position in Ecosystem

artpipelines / modUpload (consumers)
        |
   artpixeltrace (this package)
        |
   artutils (data access layer)
        |
   artcore (database/CDN infrastructure)

artpixeltrace depends on artutils and artcore for database access and CDN operations. It is used by:

Prerequisites

Before using artpixeltrace, ensure you have:

  1. Environment Variables configured for database and CDN access (see README.md)
  2. LaTeX installed via tinytex for PDF certificate generation
  3. System libraries for image processing (ImageMagick, FFTW3)
# Verify database connection
artcore::check_env_database()

# Verify CDN access
artcore::check_env_cdn()

A Complete Workflow: Verifying and Certifying Artwork

This workflow demonstrates the typical usage pattern when an artist uploads new artwork to the platform.

Step 1: Check Canvas Signature

Before processing an artwork, verify the Procreate canvas contains the artist’s signature:

# Path to uploaded canvas file
canvas_path <- "path/to/artwork.procreate"

# Check for artist signature
is_signed <- isCanvasSigned(canvas_path)

if (!is_signed) {
  stop("Canvas must be signed before certification")
}

The isCanvasSigned() function extracts the signature layer from Procreate files and checks for non-transparent pixels.

Step 2: Generate Perceptual Hash

Compute a perceptual hash to enable duplicate detection and future verification:

# Get the artwork image path
image_path <- "path/to/artwork.png"

# Compute perceptual hash
hash_result <- image_phash(image_path)

# The hash can be stored for future comparison
hash_result$art_hash # "a1b2c3d4e5f6" - 12-char identifier
hash_result$art_binary # Binary for Hamming distance comparison

Perceptual hashes are content-based fingerprints. Similar images produce similar hashes, enabling: - Detection of duplicate uploads - Verification that an image matches a registered artwork - Finding visually similar images in the database

Step 3: Generate Certificate of Authenticity

Once artwork is verified, generate the official certificate:

# Generate certificate (requires valid UUIDs from database)
cert <- renderCertificate(
  artist = "746bxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  artwork = "99xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
)

# View certificate details
cert
#>    artist_uuid                          art_uuid cert_id template_id frame_id
#> 1: 746bxxxx-... 99xxxxxx-... 000-000-123           1         3
#>           created_utc                                          path_pdf
#> 1: 2024-01-15 10:30:00 https://cdn.example.com/.../CERT-000-000-123.pdf

Step 4: Persist to Database and CDN

For production use, save the certificate to the platform:

cert <- renderCertificate(
  artist = "746bxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  artwork = "99xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  saveDB = TRUE, # Persist certificate record to database
  saveCDN = TRUE # Upload PDF and JPEG to CDN
)

# Certificate is now accessible at:
cert$path_pdf # PDF download URL
cert$path_jpeg # JPEG preview URL

Connection Management

artpixeltrace manages database connections automatically. For batch operations, you can pass an existing connection:

# Single certificate - connection managed automatically
cert <- renderCertificate(artist, artwork)

# Batch processing - share connection
cn <- artcore::..dbc()
for (artwork in artwork_list) {
  renderCertificate(artist, artwork, cn = cn, saveDB = TRUE)
}
artcore::..dbd(cn)

Next Steps