GalClean removes bright foreground and background sources (such as stars and other galaxies) from a FITS image while preserving the central galaxy. It uses Astropy (
ascl:1304.002) together with its PhotUtils module (
ascl:1609.011) to detect and mask or subtract these sources. The code can be run as a standalone script or used as a module. GalClean produces a cleaned FITS image plus diagnostic output (segmentation map and residual image). It is designed to help avoid source blending when artificially redshifting galaxy images for, for example, sample preparation.