raster : bad quality in output

Ed McNierney ed at TOPOZONE.COM
Thu Apr 7 12:00:26 EDT 2005


Didrik -

What I meant was, "are all the pixels in the relevant portion of the input image used exactly once to produce one pixel in the output image"?  That is, is the output image a rectangular piece of the original input image at the same size, or is it "zoomed in" or "zoomed out"?

Unfortunately, scale ratios are meaningless for digital images without also specifying the output resolution in pixels per physical unit (inch, cm, etc.).  It is very likely that the scale ratios of your source images refer to a different resolution than the default 72 pixels per inch that MapServer uses.

Can you find out what the intended output resolution of your rasters is?  For example, if I tell you that a raster is at 1/50000 scale, I am saying that one cm on the image equals 5 km on the ground.  But that obviously depends on the physical resolution at which the image is viewed - if I am viewing it at 50 pixels per cm, then 50 pixels in the image equals 5 km on the gorund.  But if I'm viewing it at 100 pixels per cm, then 100 pixels in the image equals 5 km on the ground.  You need to know the intended viewing resolution in order to answer this question.

If the rasters are scanned images of printed maps, this value would normally be the scan resolution.

     - Ed

P.S. I've copied this reply to the list - please always copy the whole list on discussions so we can all provide input and benefit from the answers.  Thanks!

Ed McNierney
President and Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
73 Princeton Street, Suite 305
North Chelmsford, MA  01863
Phone: +1 (978) 251-4242
Fax: +1 (978) 251-1396
ed at topozone.com
 

-----Original Message-----
From: Didrik Pinte [mailto:dpinte at itae.be] 
Sent: Thursday, April 07, 2005 11:29 AM
To: Ed McNierney
Subject: RE: [UMN_MAPSERVER-USERS] raster : bad quality in output

Le jeudi 07 avril 2005 à 11:11 -0400, Ed McNierney a écrit :
> Didrik -
> 
> Are you displaying the raster images at their full original resolution?
> If you are not doing that, MapServer will resample the image using a 
> fast and simple subsampling algorithm.  You'll get the image quickly 
> but it will be of poorer quality than most image viewers, which will 
> use high-quality but slower resampling (and often display 8-bit images 
> in 24-bit space to do that).
> 
> If you're going to need to display these images at non-native 
> resolution, you should consider resampling them in advance using 
> high-quality resampling and then using either GDAL overviews in your 
> TIFF images or create a set of grouped layers with minscale/maxscale 
> settings to select among them.
> 
>      - Ed

Hi Ed,

That may be the problem.

What do you mean exactly by "displaying the raster images at their full original resolution" ? 

--> I have received rasters for the following scale :

- 1/400000
- 1/100000
- 1/50000
- 1/25000
- 1/12500
- 1/6250
- 1/3125

--> for each directory, i've made a tile index of the images and created
a MapServer layer with MINSCALE and MAXSCALE choosen for optimal display (for example, the 1/50.000 layer is displayed between 1/75.000 and 1/35.000).

Didrik



More information about the mapserver-users mailing list