How one of Catalonia’s most visionary artists used early photography and chemistry to defeat the erasure of memory.