ZOGY performs optimal image subtraction; the code is designed specifically for the MeerLICHT and BlackGEM pipelines, but should also be useful to apply to images of other telescopes. The module accepts a new and a reference FITS image, runs SExtractor (ascl:1010.064) on them, and finds their WCS solution using Astrometry.net (ascl:1208.001). ZOGY then uses PSFex (ascl:1301.001) to infer the position-dependent PSFs of the images and SWarp (ascl:1010.068) to map the reference image to the new image and performs optimal image subtraction. This produces the subtracted image, the significance image, the corrected significance image, and the PSF photometry image and associated error image. The inferred PSFs are also used to extract optimal photometry of all sources detected by SExtractor.