Exporting mxd to image with transparent background from ArcGIS for Desktop?

I just gave this a test using ArcGIS for Desktop 10.2 on Windows 7 SP1 and was able to create a PNG and GIF files that had a transparent background that I could verify by inserting them as pictures into Word 2010 as In Front Of Text.

I followed the Exporting your map instructions from the ArcGIS 10.1 Online Help, using Rose Quartz as both Background and Transparent Color, doing so from both Data and Layout View, and otherwise taking all defaults.

PNG and GIF support transparency. They have a Transparent Color option, which selects the color in the map that will be marked as transparent. If you want to make only the background of the map image transparent, set Background Color and Transparent Color to the same color.

If at all possible, I would recommend upgrading to ArcGIS for Desktop 10.2 (or testing this on another machine with that version to decide whether you want to).


Aside from a few variables being inconsistently named this worked flawlessly.

# which is problematic to do manually due to a Windows-related bug in the ArcMap UI.
# Warning: It will make any white features (e.g. the default background color) transparent.
#
# INSTRUCTIONS:
# When in ArcMap, viewing a saved mxd...
# 1. From the Geoprocessing menu, select 'Python'.
# 2. In the new Python window, right-click somewhere after >>>, and select 'Load...'
# 3. Select this script.
# 4. When this script appears, press Enter twice to run it.
# 5. A new [mxd-name].png with transparent background will appear in the same directory as the mxd.
# 6. When finished/satisfied, close the Python window.
# http://forums.arcgis.com/threads/65463-Zoom-to-tile-and-Export-to-JPEG-with-World-   

File
import arcpy
png_res = 150    # Can adjust DPI
# Set mxd and png name
mxd = arcpy.mapping.MapDocument("CURRENT")
pngname = mxd.filePath.replace(".mxd",".png")
df = arcpy.mapping.ListDataFrames(mxd)[0]
# Calculate ideal image size from the mxd view and desired DPI
png_width = int((df.extent.XMax - df.extent.XMin) * png_res * 12 / df.scale)
png_height = int((df.extent.YMax - df.extent.YMin) * png_res * 12 / df.scale)
#Export PNG
print "Exporting: {0}\n{1} x {2} pixels, {3}- dpi".format(pngname,png_width,png_height,png_res)
arcpy.mapping.ExportToPNG(mxd, pngname, df, df_export_width = png_width,     df_export_height = png_height, resolution = png_res, transparent_color = "255, 255, 255")
#Clean up
del df, pngname, png_res, png_width, png_height, mxd