Grayscale Image Transparent Background - Problem and Solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all. I just found the solution to a problem that was vexing me badly I couldn't find any help topics on this issue, so it took me a while to solve it. I am posting this in case it helps someone else with the same problem.
I have a certain tricky project in which I have to make countless overlays of contractor as-built submittals against submitted and approved plans. The major issue is that we don't have CAD linework for most of the approved plans, so I have to use many images as backgrounds. On one particular drawing, I needed to put a yellow highlight behind certain linework in the base image. A transparent highlight over top didn't give good enough visual results. To put the highlight behind the image required transparency, but I also needed the image in grayscale, to distinguish between different phases of construction.
I converted the approved plan PDF to a PNG file using an image editor (with anti-aliasing off). Then I converted the white color to an alpha channel, making it a crisp grayscale image with transparency. I set the overlay drawing up in AutoCAD 2014 and was able to successfully plot the grayscale image, with transparent background, and all was fine.
However, after upgrading to AutoCAD 2016, the drawing no longer worked right. The image hadn't changed, and it still was transparent in an image viewer. But in AutoCAD, the grayscales of the image were all converted to black. The image looked monochrome. I was able to plot a PDF of the drawing, but the image was transparent and monochrome, not grayscale. I puzzled over this for a while, tried unloading and reloading, repathing, restarting AutoCAD, all to no avail. I knew it had worked in AutoCAD 2014, so what had changed?
I had a dim idea in the back of my mind that one of the raster image settings in AutoCAD might be responsible for the problem. I looked through the Express Tools System Variable Editor for a while and came across RASTERTHRESHOLD. I remembered this variable from somewhere in the past. I saw that it was set to 20MB. I set this variable to 1000MB, and now AutoCAD plots the transparent grayscale image perfectly!
According to the Autodesk online help for RASTERTHRESHOLD, "If the plotted raster image exceeds this threshold, the availability of system memory is checked. The plot is aborted if the image is too big for the available memory." However, it appears that this is not the whole story. At least on my installation, there is an additional undocumented behavior of RASTERTHRESHOLD, in which AutoCAD is simplifying the image from grayscale to monochrome under certain conditions.
If anyone wants more details of the installation: AutoCAD Civil 3D 2016, with Raster Design, on a Dell Precision T3600, quad-core (3.2GHz x 4), 16GB RAM, Windows 7, 64-bit.