Need help with image format conversion

I have written a code for web scraping few images with extension as .grb which I need to convert to .tif format with the correct projection.

Any help would be appreciated!