Blur of groundoverlay pixels

622 views
Skip to first unread message

Mallee

unread,
Mar 8, 2010, 6:30:41 PM3/8/10
to KML Developer Support - Google Earth Plug-in
I posted this in the Google Earth API group but it's pretty quiet...
maybe someone here has a suggestion!

I have been viewing rasters both in GE and the GE API by loading KML
Groundoverlays of PNG images, located by GLatLonQuad. The pixels are
quite large (30 x 30m) and as you zoom in, GE seems to 'blur' these.

I'd rather they remain faithful to their pixel size ie. become
pixellated as you zoom in, as in a raster, rather than blur. Is there
an API property that controls this? (I don't think there's a KML
control for it because it's not in the reference)

If not, I can imagine achieving the same effect by making the images
artificially larger (eg. make new images with 1 pixel on old image = 8
x 8 pixel square on new image) but it seems like a lot of mucking
around, and will probably lead to slower load times etc.

If anyone has a solution I'd love to hear it - thank you!

Ben

fraser (Earth API Guru)

unread,
Mar 9, 2010, 6:16:15 AM3/9/10
to KML Developer Support - Google Earth Plug-in
Hi,

I think you are miss understanding the nature of pixels.
Pixels are literally picture-elements, the basic elements that make up
a raster image.
With that in mind I don't see how you can have pixels 30m x 30m !
The blurring is likely because you can't zoom in far enough in google
earth to show the individual elements like you would in a raster
editing package.

That said, I'm not 100% I understand what you are trying to
achieve...Could you post a link to an example page or possibly some
images of what it looks like and what you would want it to look like?

F.

Met_Apps

unread,
Mar 9, 2010, 8:22:03 AM3/9/10
to KML Developer Support - Google Earth Plug-in
Mallee,
If you're trying to plot high resolution imagery (30x30 m resolution
if that's what you're referring to), you should learn how to use
superoverlay.
http://code.google.com/apis/kml/documentation/kml_21tutorial.html#superoverlays
http://sites.google.com/site/xbbster/superoverlay (3rd party software)
to help you quickly create those.
Google keyword "Superoverlay"
Met_Apps

Mallee

unread,
Mar 9, 2010, 10:13:01 PM3/9/10
to KML Developer Support - Google Earth Plug-in
Hi Fraser,
I'm coming at this from a GIS foundation (MapWindow) where a raster
image is created by mapping one grid square on a raster to one pixel
on a bitmap. Obviously when the GIS shows this on your screen at a
closer scale than 1 grid square = 1 pixel, it has to show each pixel
as a square or rectangle of pixels. Most picture editors and viewers
also use this method - when you zoom in, a pixel is presented as a
square rather than being smoothed.

GE does the same thing (will let you zoom in at closer scale than one
pixel in the overlay = 1 pixel on the screen) but..... there seems to
be some sort of interpolation algorithm, so that the image doesn't
appear pixellated... I'd like to switch the interpolation algorithm
off and have it use the same method as the GIS etc.

This is the original image: http://www.malleefocus.com.au/original.png
This is how it looks in GE: http://www.malleefocus.com.au/ge.jpg
This is how I would like it to look: http://www.malleefocus.com.au/wish.jpg

Met_Apps: Thanks for the suggestion but these images aren't large
enough (at most 200-300 pixels square) to cause that scale of problem.

Thanks again,

Ben

fraser (Earth API Guru)

unread,
Mar 11, 2010, 2:40:46 PM3/11/10
to KML Developer Support - Google Earth Plug-in
Hi Ben,

OK I understand perfectly...but sorry there is no way to alter the
rendering behaviour in the current Api.
That said, I'm not so sure that this is not directx (rather than plug-
in) related.
With that in mind you could try disabling activex (direct3D, texture
acceleration, etc) to see if the same issue of overlay blurring
occurs.
You could also try disabling activex completely to see if the same
issue occurs in openGL...

Sorry I can't help more than that...

F.

> > > Ben- Hide quoted text -
>
> - Show quoted text -

Mallee

unread,
Mar 15, 2010, 5:19:19 PM3/15/10
to KML Developer Support - Google Earth Plug-in
Hi Fraser,

Thanks - I had a feeling my options were limited! Converting the 1
pixel = 1 grid square images to 3 x 3 pixels = 1 grid square worked
(code below if anyone is ever wanting to do this).
3 x 3 pixels gives squares on the screen. The edges are only a little
blurred. I think there is probably a spline smoothing algorithm doing
the interpolation and it would only need three points to make each
square quite 'flat' colour-wise. I don't know that 2 x 2 pixel squares
would work as well (but I haven't tried).
The images don't seem that much bigger - I think PNG compression takes
care of the 3x3 pixel patterns as well as the 1 pixel patterns.

Ben

VB.Net Code:
{would love to know if there are better ways of doing this}

I is a Bitmap containing the 1 pixel = 1 grid square image
mag is the number of pixels per original pixel in the new Bitmap, IA

Dim IA As System.Drawing.Bitmap
Dim mag As Integer = 3
IA = New Bitmap(I.Width * mag, I.Height * mag, I.PixelFormat)
For rw As Integer = 0 To I.Height - 1
For cl As Integer = 0 To I.Width - 1
For j As Integer = 0 To mag - 1
For m As Integer = 0 To mag - 1
IA.SetPixel(cl * mag + j, rw * mag + m,
I.GetPixel(cl, rw))
Next
Next
Next
Next

> > > > pixellated as you zoom in, as in a raster, rather thanblur. Is there

Reply all
Reply to author
Forward
0 new messages