I am currently trying to batch compress a folder of .tif files using LZW compression in order to free up storage space. I've been using this script in ArcMap's python window, adapted from here:
# Import arcpy module
import arcpy, os
# Set the geoprocessing environments for the input and output folders
arcpy.env.workspace = r"Z:\ScannedImages\1300000\LZWCompressInput"
rasList = arcpy.ListRasters()
outWs = r"Z:\ScannedImages\1300000\LZWCompressOutput"
# Define the output settings for compression
arcpy.env.pyramid = "PYRAMIDS -1 BILINEAR JPEG 80"
arcpy.env.compression = "LZW"
# Run the Copy Raster tool
for ras in rasList:
arcpy.CopyRaster_management(ras, outWs, "0", "", "", "NONE", "NONE", "", "NONE", "NONE")
but I keep getting the dreaded ERROR 999999 or ERROR 000472. Any ideas?