[gdal-dev] Re: Border slivers and JPEG2000 compression

Jukka Rahkonen jukka.rahkonen at mmmtike.fi
Wed Dec 17 16:18:07 EST 2008

Matt Wilkie <matt.wilkie <at> gov.yk.ca> writes:

> Hi Micheal, try the nearblack utility (which is a relatively new 
> addition): http://www.gdal.org/nearblack.html
> "This utility will scan an image and try to set all pixels that are 
> nearly black (or nearly white) around the collar to exactly black (or 
> white). This is often used to "fix up" lossy compressed airphotos so 
> that color pixels can be treated as transparent when mosaicing."
> cheers,
> matt wilkie

Michael had already the original tiffs so nearblack does not help in his case.
 Or is it possible to give some PROCESSING NEARBLACK=YES keyword for MapServer?
 That would be about perfect solution for Michael. Another one that works for
sure is to make lossless JPEG2000 images.  Lossless mode keeps black as black
but compression ratio is lossless mode is just about 1:2. Third possibility is
perhaps to contruct an alfa channel to lossy JPEG2000 images for showing the
real image area but unfortunately I cannot say how it should be done.

-Jukka Rahkonen-

> Smith, Michael wrote:
> > I have several orthophotos which are TIFFs, and they align with the USGS 
> > quadrangle corners, which means they are rotated slightly, leaving small 
> > uneven slivers along the edges where pixel value is 0 (the data for 
> > these are available from adjacent tiles).  All the pixels inside the 
> > 'real' area of the photo are value > 0.
> > 

More information about the gdal-dev mailing list