PyMGal generates optical mock observations from cosmological simulations. Incorporating methods from EzGal (
ascl:1208.021), the program infers the spectral energy distributions (SEDs) of stellar particles within a simulation snapshot using customizable simple stellar population (SSP) models. These SEDs are used to calculate particle brightness through selected telescope filters. The results can be projected into realistic 2D images. The software is compatible with different simulation formats, including GADGET, GIZMO, and AREPO. Tested on IllustrisTNG, SIMBA, EAGLE, and The Three Hundred hydrodynamical simulations, PyMGal should work on other cosmological simulations as well.