blankblank blank




Adding Color Transparency To GIF/PNG Google Earth Image Overlays



In the last post, a raster image overlay of 8 meters of sea level rise flooding was loaded and positioned into Google Earth:

overheadview1

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 …

floodedblank2

… 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 …

gevector1

… 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:

jpeg-gif-save-options

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:

choose-transparent-color

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):

Google Earth overlay with transparent color

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”):

clamped

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:

8meter

This looks essentially identical to the vector overlay view at the bottom of this post. You can download this KMZ image overlay file here.

Next step: converting a series of static images like the one above into an animation in Google Earth similar to this one:


Looking for something else? Enter some keywords below, then click "Search".    




4 Responses to “Adding Color Transparency To GIF/PNG Google Earth Image Overlays”


  1. 1 vukhiembk

    How to add Gif images into Google Earth?

  2. 2 Leszek Pawlowicz

    As briefly as possible: Click on the “Add Image Overlay” button on the toolbar; select the image with the “Browse” button; use the onscreen controls to position and stretch the image to the desired location; save the resulting entry in the Places section as a KMZ file.

  3. 3 vukhiembk

    I add a Gif image into Google Earth. How to it become a moving picture on the Google Earth?

  4. 4 vukhiembk

    I was wondering if it was possible to overlay GIF animations on GE while that the the animation still runs its loops?

Comments are currently closed; feel free to contact me with questions/issues.