JPEG2000 is an image compression standard that defines a file format, includes significant new features and capabilities, and provides for both reversible (lossless) image compression, and irreversible (lossy) image compression.
Table of Contents
- Changes to Kakadu kdu_server
- A Kakadu improved find_convex_hull module
- Avoid Apple Xcode 3.2.4
- Improving Kakadu 6.4.1 JPEG2000 resd Resolution Display box
- Kakadu version 6.4.1 released
- Kakadu version 6.4 released
- JPEG2000 Comment text boxes
- GDAL --config GDAL_CACHEMAX
- GDAL supports color backgrounds
- GDAL_JP2KAK_supports_multiple_threads
- Compiling GDAL JP2KAK with gcc
- Kakadu kdu_compress progress report
- Kakadu for Mac OS X
- Kakadu version 6.3.1 released
- Kakadu version 6.3 released
- Compiling Kakadu version 6.2.1 with gcc
- Kakadu version 6.2.1 handling of TIFF images
- Kakadu version 6.2.1 released
- Kakadu version 6.2 released
- QGIS properly displays JPEG2000 images
- Kakadu Mac Intel 64 bit 20% faster than 32 bit
- Creating an RGB JP2 image from three single channel TIFF images
- Creating a reversible JPEG2000 image
- JPG versus JPEG2000
- Quickly converting the georeferencing info stored in a GeoJP2 file to text
- Web site with GDAL and QGIS compiled for Mac OS X
- Tech News Web Sites, with a presenter
- Contact Greg Coats
Changes to Kakadu kdu_server
In response to a message on the kakadu_jpeg2000@yahoogroups.com forum, with Subject: decompressor returning odd data value, Professor Taubman replied on Wed 11 May 2010, suggesting about a 100 lines to change in kdu_server.
A Kakadu improved find_convex_hull module
In response to the bias problem issue discussed on the kakadu_jpeg2000@yahoogroups.com forum, Professor Taubman released for Kakadu 6.4.1, on Tue 1 February 2011, a 46 line replacement for the find_convex_hull module in coresys/coding/block_encoder.cpp.
To reflect this source code change, I change line 94 of coresys/common/kdu_compressed.h to
#define KDU_CORE_VERSION "v6.4.1.2"
Avoid Apple Xcode 3.2.4
Under Apple Mac OS X 10.6.5, Kakadu 6.4.1, can not fully, and successfully be built with Xcode 3.2.4. This is because the Kakadu file managed/make/Makefile-MAC-x86-64-gcc requires the Sun Java file jni.h, and looks for it in /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Headers/jni.h. But installing Xcode 3.2.4, inexplicably, deletes that file. The solution, that worked for me, is to upgrade to Xcode 3.2.5, which restores this jni.h file. Also, I note that Xcode 3.2.3 includes this jni.h file. So, avoid Xcode 3.2.4.
Improving Kakadu JPEG2000 resd Resolution Display box
As explained in the book JPEG2000 Image Compression Fundamentals, Standards, and Practice by David Taubman, Chapter 14, page 589, under Display Resolution Box, the JP2 resd box, which is similar in functionality to the TIFF tags 282=XResolution, 283=YResolution, 296=ResolutionUnit, is composed of 10 bytes
2 byte Vertical Numerator
2 byte Vertical Denominator
2 byte Horizontal Numerator
2 byte Horizontal Denominator
1 byte Vertical Exponent
1 byte Horizontal Exponent
In Kakadu 6.4.1, apps/jp2/jp2.cpp, within j2_resolution::save_sub_box, I found that changing two lines from
old line 4153 v_den = 1<<15;
old line 4158 h_den = 1<<15;
to
new line 4153 v_den = (1<<16)-1;
new line 4158 h_den = (1<<16)-1;
changes the 2-byte resolution display denominator from 32768 to 65535, and as a result the values Kakadu computes and then stores in the JP2 resd box are more accurate.
For example, when reading in a TIFF image with X display resolution = Y display resolution = 200.000 pixles/cm, using 32768 as the denominator, kdu_compress creates a JP2 resd box with the value 200.012 pixels/cm, but when using 65535 as the denominator, kdu_compress creates a JP2 resd box with the value 200.000 pixels/cm. I do not see a disadvantage to changing the denominator from 32768 to 65535.
To reflect this source code change, I change line 94 of coresys/common/kdu_compressed.h to
#define KDU_CORE_VERSION "v6.4.1.1"
Roland Sweet was particularly helpful is analyzing Kakadu's creation of the JP2 resd box.
Kakadu version 6.4.1 released
On Wednesday 6 October 2010, Professor Taubman released the Kakadu JPEG2000 software, version 6.4.1.
Using Kakadu 6.4.1 adds to kdu_expand -com the -no_decode option to QUICKLY display the contents of JPEG2000 comment boxes in a .jp2 files.
For a 152 GB color image that is 260,000 columns by 195,000 rows, kdu_expand -i image.jp2 -com -no_decode takes only 0.05 seconds, while kdu_expand -i image.jp2 -com requires 10,370.87 sec = 172.84 min = 2.88 hours.
kdu_expand -i image.jp2 -com -no_decode
<<Codestream comment>>
"Aerial photograph acquired on Sunday 7 April 2002"
<<Codestream comment>>
"Kakadu-v6.4.1"
<<Codestream comment>>
"Kdu-Layer-Info: log_2{Delta-D(MSE)/[2^16*Delta-L(bytes)]}, L(bytes)
-256.0, 7.1e+09
"
Consumed 0 tile-part(s) from a total of 312 tile(s).
Consumed 23,851 codestream bytes (excluding any file format) = 0.000004
bits/pel.
0.05 real 0.00 user 0.00 sys
kdu_expand -i image.jp2 -com
<<Codestream comment>>
"Aerial photograph acquired on Sunday 7 April 2002"
<<Codestream comment>>
"Kakadu-v6.4.1"
<<Codestream comment>>
"Kdu-Layer-Info: log_2{Delta-D(MSE)/[2^16*Delta-L(bytes)]}, L(bytes)
-256.0, 7.1e+09
"
Consumed 3936 tile-part(s) from a total of 312 tile(s).
Consumed 61,813,892,820 codestream bytes (excluding any file format) = 9.753671
bits/pel.
Processed using the multi-threaded environment, with
2 parallel threads of execution (see `-num_threads')
10370.87 real 16780.72 user 200.75 sys
Kakadu version 6.4 released
On Thursday 8 July 2010, Professor Taubman released the Kakadu JPEG2000 software, version 6.4.
The Kakadu version 6.4 applications, as compiled by Taubman, for Mac OS X can be downloaded for free from Kakadu version 6.4 for Mac OS X.
Kakadu 6.4 for Mac OS X without Xcode
Under Mac OS X 10.6.4, I find that the supplied Makefile-MAC-x86-64-gcc files compile the Kakadu 6.4 Mac-x86-64-gcc command line applications successfully, without errors or warnings.
Kakadu 6.4 adds to kdu_compress and kdu_expand the -progress option, and adds to kdu_expand the -com option, that displays the contents of JPEG2000 comment text boxes.
kdu_compress -i 18stj940125.tif -o 18stj940125.jp2 Creversible=yes -progress 1000 \
-com "Aerial photograph acquired on Sunday 7 April 2002"
Copying Geo tag info, size = 387
Progress with current tile row = 20.000000%
Progress with current tile row = 40.000000%
Progress with current tile row = 60.000000%
Progress with current tile row = 80.000000%
Progress with current tile row = 100.000000%
Finished processing 1 of 1 tile rows
Initiating final codestream flush ...
Generated 1 tile-part(s) for a total of 1 tile(s).
kdu_expand -i 18stj940125.jp2 -com
<<Codestream comment>>
"Aerial photograph acquired on Sunday 7 April 2002"
<<Codestream comment>>
"Kakadu-v6.4"
<<Codestream comment>>
"Kdu-Layer-Info: log_2{Delta-D(squared-error)/Delta-L(bytes)}, L(bytes)
-192.0, 3.7e+07
"
Consumed 1 tile-part(s) from a total of 1 tile(s).
Kakadu 6.4 for Mac OS X with Xcode
Unfortunately, there are several problems with the Kakadu Xcode project files supplied to Build kdu_macshow, the Kakadu application that displays JPEG2000 images under Mac OS X.
1. Under Mac OS X 10.6.4, using Xcode 3.2.3, doing an Xcode Build fails, with this error message:
Internal error occurred while creating dependency graph: ASSERTION FAILURE in
/SourceCache/DevToolsBase/DevToolsBase-1691/pbxcore/Target.subproj/PBXTargetBuildContext.m:2061
Xcode does not follow the relative path assignment in CONFIGURATION_TEMP_DIR. A solution, suggested by Sean Doyle, is to make a change to CONFIGURATION_TEMP_DIR on 4 lines in coresys/coresys.xcodeproj/project.pbxproj and on 2 lines in apps/apps.xcodeproj/project.pbxproj. I have written a Unix shell script that makes these changes, and fixes this problem. This script can be downloaded from fix_project_pbxproj_04.sh
2. In Kakadu 6.4, lines 462 and 482 of
coresys/coresys.xcodeproj/project.pbxproj
and lines 1993 and 2020 of
apps/apps.xcodeproj/project.pbxproj
are
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
Most people, including me, will want to change them to
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
3. After making the changes noted in 1 and 2 above, the Xcode Build of kdu_macshow yields a disconcerting 340 line report of warnings. This is uncharacteristic of Kakadu, whose previous releases were known for compiling without any error or warning messages. Examing this report, I find that the Xcode Build of kdu_macshow reports 16 warnings. Of these 16 warnings, 6 are unique. The 6 unique warnings are:
#1 apps/kdu_macshow/kdms_catalog.mm :1423: warning: class 'kdms_catalog' does not implement the 'NSOutlineViewDataSource' protocol
#2 apps/kdu_macshow/kdms_catalog.mm :1426: warning: class 'kdms_catalog' does not implement the 'NSOutlineViewDelegate' protocol
#3 apps/kdu_macshow/kdms_controller.mm: 355: warning: 'CGDisplayCurrentMode' is deprecated
#4 apps/kdu_macshow/kdms_metashow.mm :1221: warning: class 'kdms_metashow_delegate' does not implement the 'NSBrowserDelegate' protocol
#5 apps/kdu_macshow/kdms_properties.mm: 428: warning: class 'kdms_properties_delegate' does not implement the 'NSBrowserDelegate' protocol
#6 apps/kdu_macshow/kdms_renderer.mm : 802: warning: 'CGDataProviderCreateDirectAccess' is deprecated
4. After the Xcode Build, I observe that none of the executables, including kdu_macshow, kdu_compress, and kdu_expand start up because they are looking for libkdu_v64R.dylib in /usr/local/lib, but the Xcode Build using the Kakadu project file puts libkdu_v64R.dylib in the same directory as the executables. The requirement by Kakadu for /usr/local/lib/libkdu_v64R.dylib is unnecessary and unreasonable. This prevents the executables, built with the Kakadu Xcode project file, for kdu_macshow, kdu_compress, and kdu_expand from being useable. Many users do not have permission to install a file in /usr/local/lib. This is a major disappointment.
Updates to Kakadu 6.4
- Professor Taubman informed the Kakadu community on Saturday, 10 July 2010 that he discovered a bug in version 6.4 of kdu_server that can cause it to crash, and said "I will work on fixing this ASAP, and release details of the fix."
- Professor Taubman informed me on Monday, 12 July 2010 that he will modify the behavior of
kdu_expand -com, so that it does not unnecessarily consume CPU time to expand the .jp2 file, and as a result displaying JP2 comments will be much faster.
- A welcome addition would be for the file
documentation/Usage_Examples.txt to include an example of using kdu_compress and kdu_expand with the -com option, to write and read JPEG2000 COM 0xff64 comment text boxes. Usage_Examples.txt is widely distributed for free with the Kakadu demostration applications for Apple Mac OS X, Sun Solaris, Mandrake Linux, and Microsoft Windows.
JPEG2000 Comment text boxes
The JPEG2000 standard supports COM 0xff64 comment text boxes. Kakadu kdu_compress supports writing JP2 COM comment text boxes. Roland Sweet and I have adapted Kakadu version 6.3.1 kdu_expand to read and then display JP2 COM comment text boxes, and we have provided this modified kdu_expand_com code to David Taubman. I am pleased that David Taubman is including the capability to read and then display JP2 COM comment text boxes in Kakadu version 6.4. Below is an example of writing, and then reading and displaying JP2 COM comment text boxes.
$ kdu_compress -i image_in.tif -o image_out.jp2 Creversible=yes \
-com "Aerial photograph acquired on Sunday 7 April 2002"
$ kdu_expand_com image_out.jp2
Aerial photograph acquired on Sunday 7 April 2002
Kakadu-v6.3.1
Kdu-Layer-Info: log_2{Delta-D(MSE)/[2^16*Delta-L(bytes)]}, L(bytes)
-49.8, 2.0e+03
GDAL --config GDAL_CACHEMAX
GDAL processing can be significantly speeded up by increasing the default for --config GDAL_CACHEMAX. I found that using gdal_translate to read in an uncompressed GeoTiff 15,000 x 15,000 x 3 = 675 MB, organized into tiles 1024x1024, and write out a GeoJPEG2000 with -co QUALITY=10 with the default --config GDAL_CACHEMAX 40 took 10,473 seconds, while specifying --config GDAL_CACHEMAX 45 took only 166 sec, which is 63 times faster.
GDAL 1.6.0, released 2008/12/04
GeoTiff 15,000 columns x 15,000 rows x 3 one-byte RGB color bands = 675 MB
gdal_translate -of JP2KAK -co QUALITY=10 --config GDAL_CACHEMAX
| GDAL_CACHEMAX in MB |
seconds |
| 40 |
10473 |
| 41 |
10327 |
| 42 |
10493 |
| 43 |
7082 |
| 44 |
3503 |
| 45 |
166 |
| 50 |
166 |
| 55 |
166 |
| 60 |
166 |
| 80 |
166 |
| 100 |
166 |
| 125 |
166 |
| 150 |
166 |
| 200 |
166 |
| 250 |
166 |
| 300 |
166 |
| 350 |
166 |
| 400 |
166 |
| 600 |
166 |
| 800 |
166 |
| 1000 |
166 |
| 1200 |
166 |
| 1400 |
166 |
| 1600 |
166 |
| 1800 |
166 |
GDAL supports color backgrounds
The Geospatial Data Abstraction Library (GDAL) programs gdal_merge.py and gdalbuildvrt have been upgraded to allow the user to specify a color background. Examples of the syntax for specifying a color background are shown at the bottom of the web pages for gdal_merge.py and gdalbuildvrt.
GDAL JP2KAK supports multiple threads
Beginning with GDAL version 1.7.1, gdal/frmts/jp2kak/jp2kakdataset.cpp, that is used to build the Kakadu based plugin /Library/Application Support/GDAL/1.7/PlugIns/gdal_JP2KAK.dylib, supports multiple threads for expanding (reading) JPEG2000 compressed images. The table below shows reduced processing times when using multiple threads.
Input = reversibly compressed .jp2
Output = uncompressed .tif |
number of threads |
| time in seconds |
unspecified |
0 |
1 |
2 |
3 |
| Kakadu kdu_expand |
53.99 |
101.28 |
101.20 |
52.21 |
51.00 |
| gdal_translate JP2KAK Kakadu |
128.06 |
195.40 |
116.39 |
123.78 |
137.13 |
| gdal_translate JPEG2000 Jasper |
218.58 |
The input image used is 16250 columns by 12188 rows by 3 bytes for RGB
The computer used is an Apple MacBook Pro with a 2.33 GHz Intel Core 2 Duo CPU
Kakadu syntax
kdu_expand -i in.jp2 -o out.tif -num_threads ${num_threads}
GDAL syntax
gdal_translate -of GTiff --config JP2KAK_THREADS ${JP2KAK_THREADS} in.jp2 out.tif
Compiling GDAL JP2KAK with gcc
Compiling GDAL version 1.7.1 of the JP2KAK Kakadu-based JPEG2000 support in frmts/jp2kak/jp2kakdataset.cpp with gcc version 4.2.1, yields 17 warning messages, that come from lines 85, 579, 2447.
To download an updated jp2kakdataset.cpp that does not yield any compiler warnings, select the following link jp2kakdataset.cpp
Kakadu kdu_compress progress report
At the conclusion of JPEG2000 processing, Kakadu kdu_compress outputs a one line summary message, similar to this
Generated 20 tile-part(s) for a total of 20 tile(s).
While this is useful, I am interesting in having kdu_compress also provide a progress report during JPEG2000 processing, followed by the one line summary message at the conclusion of JPEG2000 processing. Roland Sweet and I have added 20 lines of code to version 6.3.1 of apps/kdu_compress/kdu_compress.cpp, so that it proactively reports progress, similar to this
JP2 tiles to process = 20
JP2 tiles processed = 2 4 6 8 10 12 14 16 18 20
Generated 20 tile-part(s) for a total of 20 tile(s).
Our code changes have been provided to Professor Taubman, so that they can be incorporated into the next release of Kakadu, and are shown below.
#1 Change lines 2416-2417 from
int dwt_stripe_height)
/* This function provides exactly the same functionality as
to
int dwt_stripe_height, bool quiet)
/* This function provides exactly the same functionality as
#2 Change lines 2473 to 2475 from
// immediately.
while (!done)
to
// immediately.
int tile_count = 0 ; // count tiles processed
while (!done)
#3 Change lines 2551-2552 from
flush_on_tile_boundary = false;
}
to
flush_on_tile_boundary = false;
// This code by Roland Sweet assumes that all tiles
// are the same size as component 0 of tile 0,0.
kdu_dims tdims;
codestream.get_tile_dims( kdu_coords( 0, 0), 0, tdims );
int tile_w = tdims.size.x; // width of tile 0,0
int tile_h = tdims.size.y; // height of tile 0,0
if (!quiet)
{
if ( tile_count == 0 )
{
printf("JP2 tiles to process = %d, with each JP2 tile being %d columns by %d rows\n", (tile_indices.size.y*tile_indices.size.x), tile_w, tile_h);
printf("JP2 tiles processed = ");
}
tile_count = tile_count + tile_indices.size.x;
printf("%d ", tile_count);
fflush(stdout);
}
}
#4 Change lines 3172 to 3173 from
dwt_double_buffering,dwt_stripe_height);
}
to
dwt_double_buffering,dwt_stripe_height,quiet);
}
Wed 28 Apr 2010 update. I am delighted to report that Professor Taubman has advised me that Kakadu version 6.4 offers the -progress option to provide an indication of progress.
Kakadu for Mac OS X
To read and write .jp2 files, the Apple Mac OS X version 10.6.2 image viewing application Preview version 5.0.1 depends upon Kakadu version 5.2.1, that was released on Tue 15 Aug 2006. Since then, these Kakadu updates have been released: versions 5.2.2, 5.2.3, 5.2.4, 5.2.5, 5.2.6, 6.0, 6.1, 6.1.1, 6.2, 6.2.1, 6.3, 6.3.1.
Kakadu version 6.3.1 executables, compiled for Mac OS X, can be downloaded for free from
Kakadu for Mac OS X.
Kakadu version 6.3.1 released
On Tuesday 17 November 2009, Professor Taubman released the JPEG2000 Kakadu software version 6.3.1. The file Updates.txt notes that version 6.3.1 includes 7 minor improvements.
Kakadu version 6.3 released
Needs two changes
On Tuesday 3 November 2009, Professor Taubman released the JPEG2000 Kakadu software version 6.3. The following two changes should be made in apps/image/image_out.cpp before compiling. The lines changed are in bold.
Beginning at line 918
if ((upshift == 0) && (downshift == 0))
{ // Common case
for (; num > 0; num--, src++, dest+=inter_sample_bytes)
{
int x = src->ival;
x = (x >= x_min)?x:x_min;
x = (x <= x_max)?x:x_max;
x = x + offset;
dest[0] = (kdu_byte) x;
}
}
Beginning at line 1989
iptc_box.read(iptc_data_packet,length_of_iptc_tag);
// Writing IPTC metadata as Type=Long=4
tiffdir.write_tag(/*(((kdu_uint32) 33723)<<16) + 0x0004*/
(kdu_uint32) 0x83bb0004,length_of_iptc_tag,
iptc_data_packet);
Without the change beginning at line 918, a .tif file created by kdu_expand for an 8 bit image will have about 90% of its pixels improperly created as black.
Without the change beginning at line 1989, LibTiff will report the following error for .tif files created by kdu_expand with TIFF tag 33723 IPTC metadata:
TIFFFetchNormalTag: Warning, Incompatible type for "RichTIFFIPTC"; tag ignored.
Compiling Kakadu version 6.2.1 with gcc
Compiling Kakadu version 6.2.1 with gcc version 4.2.1 yields the following warning 45 times
warning: deprecated conversion from string constant to ‘char*’
To eliminate this warning for apps/kdu_compress/kdu_compress.cpp, change the fifth line after main = line 2758 from
kdu_args args(argc,argv,"-s");
to
kdu_args args(argc,argv,(char *)"-s");
To eliminate this warning for kdu_expand.cpp, similarly modify line 1667.
You will likely want to similarly modify the other Kakadu kdu_*.cpp programs that you compile.
Kakadu version 6.2.1 handling of TIFF images
There is a one character typo in Kakadu version 6.2.1 in apps/image/image_out.cpp, at line 1669.
apps/image/image_out.cpp line 1669 is
kdu_long out_byte_count = ((kdu_long)rows) & ((kdu_long)scanline_width);
apps/image/image_out.cpp line 1669 should be
kdu_long out_byte_count = ((kdu_long)rows) * ((kdu_long)scanline_width);
The only change is replacing & with *.
Unfortunately, the result of this typo is that all .tif files written by kdu_expand have an invalid StripByteCounts value. Trying to read these .tif files yields the error message TIFFReadDirectory:Bogus "StripByteCounts" field. As a consequence, some TIFF viewers are unable to display the image contained in .tif files created by version 6.2.1 of kdu_expand.
Additionally, I discovered some software bugs in Kakadu version 6.2.1, related to the new way that .tif files are read and written when they
1. include TIFF tag 700 XMP metadata
2. include TIFF tag 33723 IPTC metadata
3. are larger than 2 GB
4. are larger than 4 GB, BigTiff images
The solution requires changes to
apps/image/image_in.cpp
apps/image/image_out.cpp
apps/image/kdu_tiff.cpp
I emailed to Professor Taubman corrected image_out.cpp and kdu_tiff.cpp files, and he has indicated that he plans to fix image_in.cpp, so that it will respect endianness when reading and storing TIFF tag 33723 IPTC metadata, and will then incorporate all of these changes in Kakadu version 6.2.2, that he said on Monday 7 September 2009 will be released "soon".
Kakadu version 6.2.1 released
On Sunday 2 August 2009, Professor Taubman released the JPEG2000 Kakadu software version 6.2.1. The file Updates.txt notes that version 6.2.1 includes 5 minor improvements.
Kakadu version 6.2 released
On Friday 3 July 2009, Professor Taubman released the JPEG2000 Kakadu software version 6.2. The file Updates.txt notes that version 6.2 includes 34 improvements, including these 5 enhancements, that I suggested:
- Added support for the BigTIFF file format to the "kdu_compress" and "kdu_expand" demo applications by modifying Kakadu's `kdu_tiff' class to support both regular TIFF and the new BigTIFF format -- modifications to "image_in.cpp" and "image_out.cpp" to support BigTIFF were almost negligible, but modifications to the `kdu_tiff' class that they use for TIFF support were more substantial. In any event, you can now read and write TIFF files much larger than 4GB in size. Suggested by Greg Coats. [The code in apps/image/image_out.cpp on line 1670 causes kdu_expand to use BigTIFF when writing .tif files that will have more than 3,600,000,000 bytes of pixels.]
- Slightly modified "kdu_compress" and "kdu_expand" so that they read/write XMP and IPTC metadata found in TIFF files and JP2 files, as suggested by Greg Coats.
- Added the resolution scaling adjustments suggested by Greg Coats to GeoJP2 information written back to TIFF files by "kdu_expand", so that any resolution reduction is taken into account. Simultaneously modified the way in which display resolution attributes are adjusted, so that resolution information recorded in the output file (BMP or TIFF) remains correct under both resolution reduction and cropping to a region of interest.
- Fixed a bug in the TIFF reading code used by the "kdu_compress" demo application, which causes LZW compressed tiled images to be read incorrectly. Problem reported by Greg Coats, with fix provided by Margaret Lepley.
- Removed the second writing of TIFF tag RowsPerStrip when generating GeoJP2 boxes in "image_in.cpp", which was a typo. This fix was provided by Greg Coats.
QGIS properly displays JPEG2000 images
I am pleased to report that as a result of changes made on Monday 5 January 2009 to GDAL files 1.6/gdal/frmts/jpeg2000/jpeg2000dataset.cpp and 1.6/gdal/frmts/jp2kak/jp2kakdataset.cpp, QGIS properly displays JPEG2000 images using Jasper and Kakadu.
Kakadu Mac Intel 64 bit 20% faster than 32 bit
The Kakadu version 6.0 JPEG2000 software can be compiled under Apple Mac OS X 10.4 for both the Mac Intel 32 bit environment, and the Mac Intel 64 bit environment. Under Mac OS X 10.4, the Kakadu version 6.0 Mac Intel 64 bit executables are about 20% faster than the Mac Intel 32 bit executables, on an Intel Core 2 Duo, 2.33 GHz Mac.
| Kakadu version 6.0 |
32 bit |
64 bit |
speed up |
| kdu_compress |
5.65 sec |
4.69 sec |
20% |
| kdu_expand |
2.62 sec |
2.12 sec |
23% |
Creating an RGB JP2 image from three single channel TIFF images
The Kakadu syntax for combining three single channel TIFF files, representing the red, green, and blue channels, into an RGB JPEG2000 file is
kdu_compress -i red.tif,green.tif,blue.tif -o rgb.jp2 -jp2_space sRGB
Creating a reversible JPEG2000 image
The syntax for creating from a reversible (lossless) .jp2 file from a .tif input file, with Kakadu and GeoJasPer is
kdu_compress -i input_image.tif -o output_image.jp2 Creversible=yes
geojasper -f input_image.tif -F output_image.jp2
JPG versus JPEG2000
A single image from my JPG versus JPEG2000 movie, comparing JPG versus JPEG2000 versus uncompressed at the compression ratio of 108:1, showing the 3 images, and their 3 histograms, and is available for free downloading as a 1.3 MB PNG image, 1540 colums by 844 rows.
Quickly displaying the georeferencing info stored in a GeoJP2 file
The georeferencing info stored in a GeoJP2 file can be quickly displayed, without expanding the .jp2 file, using GDAL gdalinfo and GeoJasPer geojasper.
gdalinfo 18stj940125.jp2
geojasper -f 18stj940125.jp2 -T tif-o listgeo
Below is an example of the output, that includes the x,y coordinates for the four corners and the center, in UTM x,y and latitude,longitude pairs.
Geotiff_Information:
Version: 1
Key_Revision: 1.0
Tagged_Information:
ModelTiepointTag (2,3):
0 0 0
294000 4314000 0
ModelPixelScaleTag (1,3):
0.3 0.3 0
End_Of_Tags.
Keyed_Information:
GTModelTypeGeoKey (Short,1): ModelTypeProjected
GTRasterTypeGeoKey (Short,1): RasterPixelIsArea
GeogGeodeticDatumGeoKey (Short,1): Datum_North_American_Datum_1983
GeogEllipsoidGeoKey (Short,1): Ellipse_GRS_1980
ProjectedCSTypeGeoKey (Short,1): PCS_NAD83_UTM_zone_18N
PCSCitationGeoKey (Ascii,58): "Universal Transverse Mercator; North American 1983; GRS80"
ProjLinearUnitsGeoKey (Short,1): Linear_Meter
ProjNatOriginLongGeoKey (Double,1): -75
ProjNatOriginLatGeoKey (Double,1): 0
ProjFalseEastingGeoKey (Double,1): 500000
ProjFalseNorthingGeoKey (Double,1): 0
ProjScaleAtNatOriginGeoKey (Double,1): 0.9996
End_Of_Keys.
End_Of_Geotiff.
PCS = 26918 (NAD83 / UTM zone 18N)
Projection = 16018 (UTM zone 18N)
Projection Method: CT_TransverseMercator
ProjNatOriginLatGeoKey: 0.000000 ( 0d 0' 0.00"N)
ProjNatOriginLongGeoKey: -75.000000 ( 75d 0' 0.00"W)
ProjScaleAtNatOriginGeoKey: 0.999600
ProjFalseEastingGeoKey: 500000.000000 m
ProjFalseNorthingGeoKey: 0.000000 m
GCS: 4269/NAD83
Datum: 6269/North American Datum 1983
Ellipsoid: 7019/GRS 1980 (6378137.00,6356752.31)
Prime Meridian: 8901/Greenwich (0.000000/ 0d 0' 0.00"E)
Projection Linear Units: 9001/metre (1.000000m)
Corner Coordinates:
Upper Left ( 294000.000, 4314000.000) ( 77d22'37.88"W, 38d57' 2.74"N)
Lower Left ( 294000.000, 4312500.000) ( 77d22'36.25"W, 38d56'14.12"N)
Upper Right ( 295500.000, 4314000.000) ( 77d21'35.61"W, 38d57' 4.01"N)
Lower Right ( 295500.000, 4312500.000) ( 77d21'34.00"W, 38d56'15.39"N)
Center ( 294750.000, 4313250.000) ( 77d22' 5.94"W, 38d56'39.07"N)
Web site with GDAL and QGIS compiled for Mac OS X
Kyngchaos is a web site, frequently updated, that offers for free GDAL and QGIS compiled for Mac OS X.
The Geospatial Data Abstraction Library web site is available at GDAL.
The Quantum GIS web site is available at QGIS.
Tech News Web Sites, with a presenter
GeekBeat.TV "GeekBeat.TV is a short video show, about technology news, current gadgets, and amazing research projects." Presented by Luria Petrucci portraying the character Cali Lewis. Based in Dallas, Texas, USA.
Rocketboom says "We cover and create a wide range of information and commentary from top news stories to quirky internet culture." Presented by Molly Windman. Based in New York City, New York, USA.
Contact Greg Coats
Click to contact Greg Coats, the creater of this web site, via email.