<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>Border slivers and JPEG2000 compression</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT SIZE=2 FACE="Arial">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).&nbsp; All the pixels inside the 'real' area of the photo are value &gt; 0.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">This is no problem with TIFFs, as the 0 can be turned off in applications such as ArcGIS or serving them out via MapServer WMS.&nbsp; But when I convert to JPEG2000 (using Kakadu), the edge pixels are interpolated to different values, typically something like 0, 1, 2, or 3.&nbsp; Thus I can't just filter them out. Also inside the photo, sometimes very dark pixels (which should really be value 2, 3, etc) are converted to value 0.&nbsp; Thus they show up as 'holes' in applications when pixel value 0 is filtered out.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">What I want to do is simply show a bunch of JP2 tiles, with the border pixels staying as value 0, and no other pixels having value 0.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">I have tried a couple approaches, including </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">gdal_translate -a_nodata 0&nbsp;&nbsp; (the border pixels still have values &gt; 0)</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">gdal_rasterize -i -burn 0&nbsp;&nbsp;&nbsp; (won't write JP2KAK)</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Surely I'm not the first to try this, but I can't find the right steps on the web.&nbsp; Any suggestions would be appreciated.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">**********</FONT>

<BR><FONT SIZE=2 FACE="Arial">Michael Smith</FONT>

<BR><FONT SIZE=2 FACE="Arial">State GIS Manager</FONT>

<BR><FONT SIZE=2 FACE="Arial">Maine Office of GIS </FONT>
</P>

</BODY>
</HTML>