# Verify database connection
artcore::check_env_database()
# Verify CDN access
artcore::check_env_cdn()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:
-
artpipelines - Calls
renderCertificate()in the artwork verification pipeline -
modUpload - Calls
image_phash()andisCanvasSigned()during artwork uploads
Prerequisites
Before using artpixeltrace, ensure you have:
- Environment Variables configured for database and CDN access (see README.md)
- LaTeX installed via tinytex for PDF certificate generation
- System libraries for image processing (ImageMagick, FFTW3)
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 comparisonPerceptual 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.pdfStep 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 URLConnection 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
- Quickstart - Generate your first certificate in 5 minutes
- Advanced Workflow - Batch processing, duplicate detection, and custom templates
- Function Reference - Complete API documentation
