<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I think I can explain this, but probably can't fix it.....<br>
<br>
I suspect your image is grainy.... PNG-8 in mapserver is (normally)
achieved by reducing the 24bit color palette to a very simple default
256 color palette. This means that you don't get a logical choice of
what 256 color's you want in your palette. This also means that the
true color of a pixel and the "best match" color in the default palette
are ;ikely to differ significantly... hence a grainy appearance. When
you switch to png24 you avoid this progress... but watch the size of
your images.... my png24 256x256 tiles are ~65KB (and unusable)!<br>
<br>
Ideally what you want to occur in the compression to 8bit is to analyze
the 24bit images and generate a color palette that will give you best
results.. this is known as "Color Quantization"......... <br>
<br>
see: <a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/Color_quantization">http://en.wikipedia.org/wiki/Color_quantization</a><br>
<br>
I'm sorry to say, I don't think mapserver offers this... so I can't
offer you an easy solution... but hopefully an understanding of the
problem if you want to chase it up further. Try the mapserver guys :)<br>
<br>
--AH<br>
<br>
<br>
re: png being smaller.... I've tried every trick in the book (because I
really wanted to use png) and other than say a single flat color, or
the most basic of image I can never get png smaller than jpeg. Map's,
and in particular "useful" maps typically contain content, and hence
multiple colors... consequently png is always bigger for me anyway. I
wouldn't always recommend jpeg over png, I'd just look at whats most
important to you, quality or size. Hope this was of some value....<br>
<br>
<br>
<br>
Bradley Mclain wrote:
<blockquote
cite="midbef0f9b70707101935h77f45df9mab3655690dc3d3ac@mail.gmail.com"
type="cite">Sorry for the triple reply but I managed to solve it by
editing the Mapserver/Untiled.js file to have default image type as
png24.<br>
<br>
<div><span class="gmail_quote">On 7/11/07, <b
class="gmail_sendername">Bradley Mclain
</b> <<a href="mailto:bradleym06@gmail.com" target="_blank"
onclick="return top.js.OpenExtLink(window,event,this)">bradleym06@gmail.com</a>>
wrote:</span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Little
update which might help shed some light on the matter. I saved that
particular layer and it is a PNG format
<br>
not PNG24 or jpeg, so somehow OpenLayers request to Mapserver is
ignoring the new formats.<br>
<br>
I did WMS URL requests to Mapserver and it returns the correct formats.
<div><span><br>
<br>
<div><span class="gmail_quote">On 7/11/07, <b
class="gmail_sendername">Bradley Mclain</b> <<a
href="mailto:bradleym06@gmail.com" target="_blank"
onclick="return top.js.OpenExtLink(window,event,this)">
bradleym06@gmail.com</a>> wrote:</span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">For
some reason this is not working for me, I changed the settings in the
Mapfile and defined the OUTPUTFORMAT and then added the
format:'image/png', to my Openlayers folder. I even tried changing my
mapfile to export as jpeg so as to match Openayers but no luck.
<br>
<br>
Could it have something to do with that I am using the
MapServer.Untiled layer function instead of a WMS.Untiled layer?
<div><span><br>
<br>
<div><span class="gmail_quote">On 7/10/07, <b
class="gmail_sendername">Andrew Hughes</b> <<a
href="mailto:azza@lisasoft.com" target="_blank"
onclick="return top.js.OpenExtLink(window,event,this)">azza@lisasoft.com</a>>
wrote:</span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">Bart's correct... but
just be warned.... jpeg is A LOT smaller is size
than png-24. There's a reason why jpeg is the default in OpenLayers.<br>
<br>
--AH
<div><span><br>
<br>
Bart van den Eijnden (OSGIS) wrote:
<blockquote
cite="http://mid69fcb8fefbc45268e4a3e26376811703@145.50.39.11"
type="cite">
<pre>OpenLayers uses jpeg by default for WMS layers, so change it in the
constructor of your WMS.Untiled layer:
'format':'image/png', i.e.:
baselayer0 = new OpenLayers.Layer.WMS.Untiled
( "Standaard",
<a
href="http://test.intranet.rijkswaterstaat.nl/services/geoservices/startkaart?"
target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">"http://test.intranet.rijkswaterstaat.nl/services/geoservices/startkaart?"
</a>,
{layers: 'startkaart', 'format':'image/png', 'transparent':'TRUE'},
{'numZoomLevels': 12, 'ratio':1, isBaseLayer: true} );
Also check you have image/png mapped as a mimetype for PNG24 in your
Mapserver MAP file (OUTPUTFORMAT section).
Best regards,
Bart
--
Bart van den Eijnden
OSGIS, Open Source GIS
<a href="http://www.osgis.nl" target="_blank"
onclick="return top.js.OpenExtLink(window,event,this)">
http://www.osgis.nl</a>
--------- Oorspronkelijk bericht --------
Van: Bradley Mclain <a href="mailto:bradleym06@gmail.com"
target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"><bradleym06@gmail.com></a>
Naar: OpenLayers ML <a href="mailto:dev@openlayers.org" target="_blank"
onclick="return top.js.OpenExtLink(window,event,this)"><dev@openlayers.org></a>
Onderwerp: [OpenLayers-Dev] Poor Image Quality
Datum: 10/07/07 05:07
</pre>
<blockquote type="cite">
<pre>I am importing an image as an untiled Mapserver layer into OpenLayers and
</pre>
</blockquote>
<pre>it is of extremely good quality but when it shows up in OpenLayers it&#39;s
quality is terrible.The image when viewed through Mapserver is not as good
as the original but it still much better than what it is showing up as in
OpenLayers. I have my Mapserver image format as PNG24.
</pre>
<blockquote type="cite">
<pre>Any ideas on what might be causing this and how to fix it?CheersBrad
_______________________________________________
Dev mailing list
<a href="mailto:Dev@openlayers.org" target="_blank"
onclick="return top.js.OpenExtLink(window,event,this)">
Dev@openlayers.org</a>
<a href="http://openlayers.org/mailman/listinfo/dev" target="_blank"
onclick="return top.js.OpenExtLink(window,event,this)">http://openlayers.org/mailman/listinfo/dev</a>
</pre>
</blockquote>
<pre>_______________________________________________
Dev mailing list
<a href="mailto:Dev@openlayers.org" target="_blank"
onclick="return top.js.OpenExtLink(window,event,this)">Dev@openlayers.org</a>
<a href="http://openlayers.org/mailman/listinfo/dev" target="_blank"
onclick="return top.js.OpenExtLink(window,event,this)">http://openlayers.org/mailman/listinfo/dev</a>
</pre>
</blockquote>
<br>
<br>
</span></div>
<br>
</div>
<br>
<br clear="all">
</blockquote>
</div>
<br>
</span></div>
</blockquote>
</div>
<br>
</span></div>
</blockquote>
</div>
<br>
</blockquote>
<br>
<br>
</body>
</html>