[ka-Map-users] PNG transparency in IE - some conclusions

Ehud Shabtai eshabtai at gmail.com
Tue Apr 11 02:57:11 EDT 2006


Oops, I forgot the patch. Here it is.

On 4/11/06, Ehud Shabtai <eshabtai at gmail.com> wrote:
> Attached is a patch against the current CVS snapshot.
>
> After applying this patch, to enable alpha transparency you need to
> add an explicit "imageformat ALPHA" entry in the METADATA section of a
> layer you want to be transparent.
> You will also need to make sure that mapserver generates PNGs with
> alpha channel transparency, use something like:
>
> OUTPUTFORMAT
>   NAME PNG24
>   DRIVER "GD/PNG"
>   EXTENSION "png"
>   MIMETYPE "image/png"
>   IMAGEMODE RGBA
>   TRANSPARENT ON
> END
>
> Here's an example of some anti aliased lines drawn over a landsat
> image. Each is drawn as a different layer:
>
> http://www.freemap.co.il/ka-map/?map=landsat&cps=34.839482783870054,32.005894883841854,30000&layers=%u05EA%u05DE%u05D5%u05E0%u05EA%20%u05DC%u05D5%u05D5%u05D9%u05DF,%u05DB%u05D1%u05D9%u05E9%u05D9%u05DD
>
> On 4/10/06, Shoaib Burq <hydromap at gmail.com> wrote:
> > Well done Ehud, yea please can post the diffs... is there any reason
> > why the PNG's not created with alpha channel currently -- perhaps
> > size?
> >
> > On 4/9/06, Ehud Shabtai <eshabtai at gmail.com> wrote:
> > > Hi all,
> > >
> > > I just spent some hours playing with different PNG variants using
> > > ka-map and displaying them on IE.
> > >
> > > Here's what I learned:
> > >
> > > 1. IE supports PNG transparency for indexed color PNGs (i.e. not true
> > > color PNGs).
> > > 2. Using the famous hack, IE can display RGBA PNGs (the hack only
> > > works on true color with alpha channel PNG).
> > >
> > > ka-map point of view:
> > >
> > > The png files of ka-map's icons should be converted to indexed color
> > > to be displayed correctly. I converted the sun_white.png icon file and
> > > now it displays fine on IE.
> > >
> > >
> > > Displaying PNG layers with transparency on IE:
> > >
> > > This is possible if you use RGBA PNG (24 bits for colors + 8 bit for
> > > alpha channel).
> > > Some changes are required in ka-map:
> > >
> > > 1. tile.php - when it cuts a meta tile into the smaller tiles it does
> > > not copy the alpha channel. This should be changed so if the generated
> > > mapserver PNG image contains alpha channel it is copied to the tiles.
> > >
> > > 2. Currently the IE hack is never called in ka-map even for png files.
> > > In addition the actual hack must be issued after the image has been
> > > loaded (i.e. in kaMap_imgOnLoad), otherwise panning is really bad in
> > > IE.
> > >
> > >
> > > If there's interest i can provide my diffs.
> > >
> > >
> > > --
> > > Ehud Shabtai
> > > http://www.freemap.co.il/map/
> > >
> > > _______________________________________________
> > > ka-Map-users mailing list
> > > ka-Map-users at lists.maptools.org
> > > http://lists.maptools.org/mailman/listinfo/ka-map-users
> > >
> >
>
>
> --
> Ehud Shabtai
> http://www.freemap.co.il/map/
>


--
Ehud Shabtai
http://www.freemap.co.il/map/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ka-map-alpha.patch
Type: text/x-patch
Size: 4560 bytes
Desc: not available
Url : http://lists.maptools.org/pipermail/ka-map-users/attachments/20060411/cd32a4e3/ka-map-alpha.bin


More information about the ka-Map-users mailing list