An optimal extraction algorithm for imaging photometry | Synapse