Ideally you should input the monthday values in a vector or list:
monthdays <- c("monthday1", "monthday2", ...)
Then it becomes easy to loop on the values in the vector or use vectorized functions. For example to create BFG:
stringr::str_replace("aa bb cc", "bb", c("dd","ee"))
#> [1] "aa dd cc" "aa ee cc"
Similarly, if you have the days in a vector, it is easy to generate all the filenames:
days <- c("2020-04-01", "2020-04-02")
paste0("figures/April/modis2020/",days, "_Modis_2020.png")
#> [1] "figures/April/modis2020/2020-04-01_Modis_2020.png"
#> [2] "figures/April/modis2020/2020-04-02_Modis_2020.png"
So what I would recommend is to generate a data frame, with one row per day (i.e. one row per png to generate), put the actual code generating the png (including png(), imagep() and dev.off()) in a function, then use purrr::walk() to loop over the rows of the dataframe and generate all the pngs.
If you're not comfortable with these functions, the other approach is to generate all the vectors needed to make the figures, then to use a for loop:
all_monthdays <- c("xx", "yy", ...)
all_BFGs <- stringr::str_replace(chl, ocean, all_monthdays)
days <- str_extract(all_monthdays, "2020-[0-9]{2}-[0-9]{2}")
all_paths <- paste0("figures/April/modis2020/",days, "_Modis_2020.png")
all_titles <- ...
color <- colorRampPalette(...)
for(i in seq_along(all_BFGs)){
png(all_paths[i], width=2400)
imagep(longitude, latitude, log10(all_BFGs[i]), ...)
title(main = all_titles[i])
dev.off()
}