Float image data support

82 views
Skip to first unread message

Bob Pasteur

unread,
Apr 12, 2018, 12:22:30 PM4/12/18
to OpenJPEG
Hi, can anybody tell me if the latest OpenJPEG code has support for float as the data type of a component? 

All I can find on line is a post from 2015 saying is does not:


If not, are there plans to implement it?

Thanks in advance,

Bob

Even Rouault

unread,
Apr 12, 2018, 12:33:43 PM4/12/18
to open...@googlegroups.com, Bob Pasteur
On jeudi 12 avril 2018 12:22:27 CEST Bob Pasteur wrote:
> Hi, can anybody tell me if the latest OpenJPEG code has support for float
> as the data type of a component?

JPEG2000, at least in its Part-1 implemented in OpenJPEG, has no provision for
floating point data. So if you want to support it, you'll have to use tricks/
hacks.

For another project I'm involved in, which uses different backends for
JPEG2000 support, one of the backend has support for Float32 using the
following trick:

SPLIT_IEEE754=YES/NO: Whether encoding of Float32 bands as 3 bands with values
decomposed according to IEEE-754 struture: first band (1 bit, signed) with
sign bit, second band (8 bits, unsigned) with exponent value and third band
(23 bits, unsigned) with mantissa value. Default to NO. This is a non-standard
extension to encode floating point values. By default, the sign bit and
exponent will be encoded with the reversible wavelet (even with
REVERSIBLE=NO), and the mantissa with the irreversible one. If specifying
REVERSIBLE=YES, all 3 components will be encoded with the reversible wavelet.

(This is taken from http://gdal.org/frmt_jp2lura.html )

This could probably be done with OpenJPEG as well. The only thing to chck is
that the 23bits mantissa channel is properly supported by OpenJPEG.

Even

--
Spatialys - Geospatial professional services
http://www.spatialys.com
Reply all
Reply to author
Forward
0 new messages