Question: I know that one isn’t supposed to draw the sun or moon. Does that prohibition also extend to taking pictures of a sunset?
Answer: The Gemara (Rosh Hashana 24b) asks how Rabban Gamliel could have had diagrams of the moon in various phases as the halacha is that one mustn’t create pictures of the sun and moon, etc. as they were worshipped by the pagans. The Gemara concludes that he had special dispensation to do so as he needed them to question witnesses who had reported seeing the new moon and for teaching others. Thus, the Shulchan Aruch (YD 141:4) writes that one mustn’t draw any such pictures unless they are for educational purposes (See Igros Moshe YD 3:33; Minchas Yitzchak 10:72; Shevet Halevi 7:134:8).
While the Shulchan Aruch writes that one mustn’t even keep such pictures in one’s home, the Chochmas Adam (85:5) and Darkei Teshuva (YD 141:34) write that this only applies to three dimensional images.
R’ Yitzchak Yaakov Weiss (Minchas Yitzchak 10:72) writes that photographing a sunset is prohibited. R’ Shmuel Wosner (Shevet Halevi 7:134:6) writes that while one can’t process or keep such a picture, there is no prohibition is taking the picture.
In conclusion, one can take a picture of a sunset and save it to one’s computer, etc. though one should be careful not to print it unless they are going to use it for educational purposes.