The Earth’s upper atmosphere is constantly bombarded by cosmic rays (CRs). The interactions produce cascades of secondary particles including gamma rays. In any particular region of the upper atmosphere, CRs with insufficient rigidity (momentum per charge) are excluded because they are deflected by the Earth’s magnetic field. Therefore, CR fluxes vary with geographical location, being highest near the poles and lowest near the equator. Here we analyze the Earth’s gamma-ray data between 0.2 – 20 GeV from the Fermi Large Area Telescope (LAT) and verify the inverse association between the photon intensity and the direction-dependent geomagnetic cutoff rigidity. The emission from the Earth’s stratosphere is mapped in geographical coordinates, creating the first images of the Earth in gamma rays. We confirm and quantify the solar modulation effects on the Earth’s gamma- ray spectrum. Utilizing the geomagnetic field as a spectrometer, we also report the stratospheric gamma-ray yield per CR proton as a function of CR rigidity as observed at the LAT altitude. This research project is partly supported by Thailand Science Research and Innovation (RTA6280002) and Research Grant for New Scholar (MRG6280155).