Raster - TIF vs JPG

Jeff Hoffmann jeff at PROPERTYKEY.COM
Mon Aug 21 12:31:51 EDT 2006


Roland Martin wrote:

> Presumably JPG images require decompression prior to creating the output 
> image, whereas TIFFs can just be read straight off.

Depending on your application, amount of disk space you have/need, etc. 
it may be a good idea to go with JPEGs.  The problem is that yes, you do 
have to decompress them and that takes time and you are losing a bit of 
quality.  The key is to keep the JPEGs small (say 500x500 pixels) so 
that step is quick.  If you're decompressing big images (say 10000x10000 
pixels), that's going to take a while no matter what.  This can lead to 
a storage nightmare trying to manage a million JPEGs -- if you use 
JPEGs, you'd be better off storing them as tiled JPEG-compressed TIFFs. 
  With tiled TIFFs, you get the advantage of it acting like a bunch of 
small JPEGs in terms of performance while having big images/small number 
of files to manage.   Also make sure that they're compressed at a higher 
quality than you expect to use in Mapserver because you'll be doing 
lossy compression on top of lossy compression if you server them as 
JPEGs out of Mapserver.  You'll want to do some tests to make sure 
you're getting high enough quality output.  And remember, you'll never 
got that quality back after you compressed them, so make sure you keep a 
copy of the source.

Finally, no matter what format you use, make overviews.  If you have a 
fixed set of map scales for your application, you can build overviews 
that match those scales and that will save some processing time.  If 
not, just do them at powers of 2 (1/2,1/4,1/8,etc) until the images are 
small (again, I stop around 500x500 pixels.  If you end up with a lot of 
small images, you can merge them together and start over making overviews.)

-- 
Jeff Hoffmann
Head Plate Spinner
PropertyKey.com



More information about the mapserver-users mailing list