In the last post, a raster image overlay of 8 meters of sea level rise flooding was loaded and positioned into Google Earth:
But the white areas of the original raster image obscure the underlying aerial photography, even when the raster image is made partially transparent. It would be useful to make that original white area completely transparent, while preserving the blue areas that represent areas flooded by the sea, and that can be done in Google Earth.
Google Earth supports the transparent color capabilities of both PNG and GIF images, so if I take my original TIFF graphic image …
… and then convert it to a GIF or PNG format, specifying white as a transparent color, the resulting image should look more like a vector overlay created earlier …
… where the areas uncovered by flooding show no overlay at all.
Many standard photo editors support the specification of a transparent color in GIF or PNG images; check the help section of your preferred editor to see if it does. Although I have several editors that let you set colors in GIF and PNG images as transparent, the program I use most often for saving an image as a GIF or PNG with transparency is the free image viewer and converter IrfanView. If you download the optional Plug-ins, IrfanView can open just about every single image format out there, and can also convert them into most non-proprietary formats as well; it even supports Photoshop plugins. The newest version (4.0) lets you open a GPS-geocoded picture directly in Google Earth.
Opening the original TIFF raster image in IrfanView, choosing File => Save As, and specifying GIF as the “Save as type:, the JPEG/GIF Options window comes up:
Make sure that the “Save transparent color” box is checked, and “Choose transparent color during saving” is selected. When you “Save” the GIF image, you’ll get a “Choose transparent color” window:
In this case, I want the white areas to be transparent, so I click on any white area of the image. The resulting GIF now has the original white areas specified as the “transparent” color. The process for adding transparency to PNG image is similar.
If I follow the steps in this post but use this new transparent GIF instead of the original TIFF, I get the following image overlay in Google Earth (here set to have some transparency):
Compare that with the first image, and you’ll see that the areas obscured by white in the first image overlay are now transparent in this second image.
There’s one more thing I can do with this image overlay. The default is for the overlay to be “Clamped to ground”, i.e. lying draped on the terrain surface. But if you go to the overlay Properties, you can set the altitude of the overlay to be at 8 meters in Absolute mode relative to sea level. This way, instead of having the flooded area draping the terrain like this (“Clamped to ground”):
You can show it as being at 8 meters above sea level, so that the bases of the buildings are covered by the appropriate depth of water:
Next step: converting a series of static images like the one above into an animation in Google Earth similar to this one: