[mapserver-users] ECW Image Quality

Richard Greenwood Rich at GreenwoodMap.com
Tue Jan 22 09:00:39 PST 2002


Frank,

I started with a 24 bit tiff and made the ecw. I tried various options with 
the ecw compressor, but none of them made any noticeable difference.

Here's the gdalinfo for the 24 bit tiff:

    Driver: GTiff/GeoTIFF
    Size is 6000, 5000
    Coordinate System is `'
    Origin = (2417000.000000,1420500.000000)
    Pixel Size = (1.000000,-1.000000)
    Metadata:
      TIFFTAG_SOFTWARE=Horizons TIFF Library (c) 1994  3.73 - (GEO-JPEG) 
21-Apr-99  rlb
    Corner Coordinates:
    Upper Left  ( 2417000.000, 1420500.000)
    Lower Left  ( 2417000.000, 1415500.000)
    Upper Right ( 2423000.000, 1420500.000)
    Lower Right ( 2423000.000, 1415500.000)
    Center      ( 2420000.000, 1418000.000)
    Band 1 Block=6000x1 Type=Byte, ColorInterp=Red
      Min=0.000/0, Max=255.000/0
    Band 2 Block=6000x1 Type=Byte, ColorInterp=Green
      Min=0.000/0, Max=255.000/0
    Band 3 Block=6000x1 Type=Byte, ColorInterp=Blue
      Min=0.000/0, Max=255.000/0

The fact that my photogrammetrist supplied a 24 bit tiff doesn't mean that 
it might have been a 8 bit image at some point in its processing. I've used 
photoshop to convert the 24 bit tiffs into 8 bit indexed color tiffs and I 
can't say I really see any difference. (The indexed color tiffs are what 
I'm serving via mapserver, and they look really good)  I also tried making 
the ecw from the indexed color tiff, but it didn't look much better. Would 
a gdalinfo of the indexed color tiff be useful?

Thanks for your help.

Best regards,
Rich

At 09:49 AM 1/22/2002 -0500, you wrote:
>Brad / Rich,
>
>The MapServer support for 24bit images via GDAL maps them into a 5x5x5
>fixed color cube; which not surprisingly sucks for smoothly varying images.
>You mention that conversion to TIFF and then displaying via MapServer works
>fine.  Could you provide a "tiffinfo" or similar report on the TIFF file?
>I wonder if it has already been rendered down to 8bit using a more
>intellegent mechanism.
>
>We could modify MapServer to use error diffusion to improve the quality of
>the result though the real fix is to make MapServer support 24bit output.  It
>is currently limited to 8 bit paletted output.
>
> > I also experienced the black image as I was zooming in close to the photo.
> > I can't explain that, anyone else getting this ?
>
>I think I know what this is.  MapServer is requesting GDAL to "upsample"
>the image, and GDAL asked the ECW library the same thing but the ECW
>library doesn't support upsampling.  I don't see this problem in my other
>applications because they will generally never ask for data at higher
>resolution that 1:1.
>
>I have added a TODO item to myself to fix this but I am not sure when I
>will get to it.  Feel free to prompt me now and then.
>
> > I am also getting an error that says:
> >
> > -----------------
> > CGI Error
> > The specified CGI application misbehaved by not returning a complete set of
> > HTTP headers. The headers it did return are:
> >
> > abnormal program termination
> > -----------------
> >
> > when I try using an ECW image that is large (671 MB).  It only happens
> > sometimes and if I look at the memory consumption on my machine it only
> > seems to happen when it gets to ~35MB usage for the mapserv.exe 
> process.  If
> > the memory consumed is less than this approximate value then there is not a
> > problem displaying the image (albeit in 8 bit).
>
>Skimming the code, I see an embarrassing memory leak that I imagine is
>responsible.  I have checked a fix into gdal/frmts/ecw/ecwdataset.cpp.
>
>Best regards,
>
>--
>---------------------------------------+--------------------------------------
>I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
>light and sound - activate the windows | http://pobox.com/~warmerdam
>and watch the world go round - Rush    | Geospatial Programmer for Rent


Richard W. Greenwood, PLS
Greenwood Mapping, Inc.
Rich at GreenwoodMap.com
(307) 733-0203
http://www.GreenwoodMap.com




More information about the MapServer-users mailing list