I need to convert TIFFs to BMPs using CopyRaster from ascii to raster output TIFFs. I am not sure how to define the "outRaster" so that it will convert the rasters to BMP. I'm guessing that the line of code which I denote below needs additional consideration.
import os,arcpy,glob
rasterpath = r"C:\VMshared\small_example_valley2\snowdepthout"
outFolder = r"C:\VMshared\small_example_valley2\snowrast"
rasterList = glob.glob(rasterpath + "/*.tif")
for rasterFile in rasterList:
outRaster = os.path.join(outFolder, rasterFile + "bmp") #THIS LINE??
arcpy.CopyRaster_management(rasterFile,outRaster,"#","-3.402823e +038","NONE","NONE","8_BIT_UNSIGNED","ScalePixelValue","NONE")
***NOTE - The code below works to convert to jpg or bmp although I would guess some syntax is missing.
import os,arcpy,glob
arcpy.env.workspace = r"C:\VMshared\small_example_valley2\snowtest2"
outFolder = r"C:\VMshared\small_example_valley2\snowtest3"
for rasterFile in arcpy.ListRasters("*.tif"):
oName, oExt = os.path.splitext(rasterFile + ".jpg")
outRaster = os.path.join(outFolder, oName + ".jpg")
arcpy.CopyRaster_management(rasterFile,outRaster,"#","#","-9999","NONE","NONE","8_BIT_UNSIGNED","NONE","NONE")