Skip to content

Commit 8a17527

Browse files
committed
docs: explain how to write Ultra HDR images
Signed-off-by: Loïc Vital <mugulmotion@gmail.com>
1 parent 50f4ce9 commit 8a17527

1 file changed

Lines changed: 47 additions & 27 deletions

File tree

src/doc/builtinplugins.rst

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ attributes are supported:
209209
* - ``oiio:ioproxy``
210210
- ptr
211211
- Pointer to a ``Filesystem::IOProxy`` that will handle the I/O, for
212-
example by reading from memory rather than the file system.
212+
example by reading from memory rather than the file system.
213213

214214
Additionally, an integer ``dds:bc5normal`` global attribute is supported
215215
to control behavior of images compressed in BC5/ATI2 compression format.
@@ -555,7 +555,7 @@ storage. Currently, OpenImageIO only supports 2D FITS data (images), not 3D
555555
- int
556556
- The number of subimages in the file.
557557
* - *other*
558-
-
558+
-
559559
- all other FITS keywords will be added to the ImageSpec as arbitrary
560560
named metadata.
561561

@@ -885,7 +885,7 @@ attributes are supported:
885885
* - ``oiio:ioproxy``
886886
- ptr
887887
- Pointer to a ``Filesystem::IOProxy`` that will handle the I/O, for
888-
example by reading from memory rather than the file system.
888+
example by reading from memory rather than the file system.
889889

890890
**Configuration settings for ICO output**
891891

@@ -1051,7 +1051,7 @@ anywhere near the acceptance of the original JPEG/JFIF format.
10511051
- Describes the chroma subsampling, e.g., ``"4:2:0"`` (the default),
10521052
``"4:4:4"``, ``"4:2:2"``, ``"4:2:1"``.
10531053
* - ``Exif:*``, ``IPTC:*``, ``XMP:*``, ``GPS:*``
1054-
-
1054+
-
10551055
- Extensive Exif, IPTC, XMP, and GPS data are supported by the
10561056
reader/writer, and you should assume that nearly everything described
10571057
Appendix :ref:`chap-stdmetadata` is properly translated when using
@@ -1111,6 +1111,10 @@ control aspects of the writing itself:
11111111
- int
11121112
- If nonzero, extra attributes will be written into the file as comment
11131113
blocks.
1114+
* - ``jpeg:ultrahdr``
1115+
- int
1116+
- If nonzero, the image will be written as an Ultra HDR image (see the
1117+
:ref:`Ultra HDR <sec-bundledplugins-jpeg-ultrahdr>` section below).
11141118

11151119

11161120
**Custom I/O Overrides**
@@ -1132,9 +1136,11 @@ via the `ImageInput::set_ioproxy()` method and the special
11321136
mode and do not support tiled image input or output.
11331137

11341138

1139+
.. _sec-bundledplugins-jpeg-ultrahdr:
1140+
11351141
**Ultra HDR**
11361142

1137-
JPEG input also supports Ultra HDR images.
1143+
JPEG input and output support Ultra HDR images.
11381144
Ultra HDR is an image format that encodes a high dynamic range image
11391145
in a JPEG image file by including a gain map in addition to the
11401146
primary image.
@@ -1143,6 +1149,21 @@ a complete reference on the Ultra HDR image format.
11431149
In the specific case of reading an Ultra HDR image, JPEG input will also
11441150
support alpha channels and high dynamic range imagery (`half` pixels).
11451151

1152+
Ultra HDR *output* is enabled by setting the ``jpeg:ultrahdr`` attribute to a
1153+
nonzero value. This makes it possible, for example, to convert a linear HDR
1154+
OpenEXR image into a widely shareable Ultra HDR JPEG.
1155+
When writing Ultra HDR, the following requirements apply:
1156+
1157+
* The pixel data type must be ``half`` or ``float`` (an HDR-capable, linear
1158+
data type).
1159+
* The image must have at least 3 channels. If a 4th channel is present it is preserved;
1160+
RGB images are written with an opaque alpha.
1161+
* The image's ``oiio:ColorSpace`` must be a linear scene-referred space whose
1162+
primaries are Rec.709, Display-P3, or Rec.2020 (i.e. ``lin_rec709_scene``,
1163+
``lin_p3d65_scene``, or ``lin_rec2020_scene``). The color gamut written to
1164+
the file is inferred from this.
1165+
* The base image JPEG quality is taken from the ``compression`` attribute
1166+
(e.g. ``compression="jpeg:90"``), defaulting to 95.
11461167

11471168

11481169
|
@@ -1210,8 +1231,8 @@ attributes are supported:
12101231
- ptr
12111232
- Pointer to a ``Filesystem::IOProxy`` that will handle the I/O, for
12121233
example by reading from memory rather than the file system.
1213-
1214-
If OpenJPH is installed, the reader will attempt to read the file first with
1234+
1235+
If OpenJPH is installed, the reader will attempt to read the file first with
12151236
the OpenJPH library, and if that fails, it will fall back to the OpenJPEG library.
12161237

12171238
**Configuration settings for JPEG-2000 output**
@@ -1260,7 +1281,7 @@ writer will attempt to write the file with the OpenJPH library, and the followin
12601281
- (5) number of decompositions.
12611282
* - ``jph:block_size``
12621283
- string
1263-
- The output block size, defaults to 64,64
1284+
- The output block size, defaults to 64,64
12641285
* - ``jph:prog_order``
12651286
- string
12661287
- (RPCL) is the progression order, and can be one of:
@@ -1277,7 +1298,7 @@ writer will attempt to write the file with the OpenJPH library, and the followin
12771298
is repeated for all finer resolutions
12781299
* - ``jph:qstep``
12791300
- float
1280-
- If supplied, is the quantization step size for lossy compression;
1301+
- If supplied, is the quantization step size for lossy compression;
12811302
quantization steps size for all subbands are derived from this value. Valid values can be from 0.00001 to 0.5.
12821303
If not used, the encoder will be lossless.
12831304

@@ -1317,7 +1338,7 @@ attributes are supported:
13171338
- ptr
13181339
- Pointer to a ``Filesystem::IOProxy`` that will handle the I/O, for
13191340
example by reading from memory rather than the file system.
1320-
1341+
13211342
**Configuration settings for JPEG XL output**
13221343

13231344
When opening a JPEG XL ImageOutput, the following special metadata tokens
@@ -1354,7 +1375,7 @@ control aspects of the writing itself:
13541375
- float
13551376
- Target visual distance in JND units, lower = higher quality.
13561377
0.0 = mathematically lossless. 1.0 = visually lossless.
1357-
Recommended range: 0.5 .. 3.0. Allowed range: 0.0 ... 25.0.
1378+
Recommended range: 0.5 .. 3.0. Allowed range: 0.0 ... 25.0.
13581379
Mutually exclusive with ``*compression jpegxl:*```.
13591380
* - ``jpegxl:effort``
13601381
- int
@@ -1614,8 +1635,8 @@ The official OpenEXR site is http://www.openexr.com/.
16141635
- the MIPmap rounding mode of the file.
16151636
* - ``openexr:dwaCompressionLevel``
16161637
- float
1617-
- compression level for dwaa or dwab compression (default: 45.0).
1618-
Reflects the level used when reading an existing file. To set
1638+
- compression level for dwaa or dwab compression (default: 45.0).
1639+
Reflects the level used when reading an existing file. To set
16191640
the compression level, use the ``compression`` attribute.
16201641
* - ``openexr::luminancechroma``
16211642
- int
@@ -1636,7 +1657,7 @@ The official OpenEXR site is http://www.openexr.com/.
16361657
This metadata was added in OpenImageIO 3.1, and is only supported when
16371658
OIIO is built against OpenEXR 3.1 or newer.
16381659
* - *other*
1639-
-
1660+
-
16401661
- All other attributes will be added to the ImageSpec by their name and
16411662
apparent type.
16421663

@@ -1822,7 +1843,7 @@ files use the file extension :file:`.png`.
18221843
- float
18231844
- pixel aspect ratio
18241845
* - ``XResolution``, ``YResolution``, ``ResolutionUnit``
1825-
-
1846+
-
18261847
- resolution and units from the PNG header.
18271848
* - ``oiio:ColorSpace``
18281849
- string
@@ -1968,7 +1989,7 @@ Without loss of generality, we will refer to these all collectively as
19681989
for those who reject the nonsense about naming the files depending on the
19691990
number of channels and bitdepth.
19701991

1971-
PNM files are widely used in the Unix world as simple ASCII or binary image
1992+
PNM files are widely used in the Unix world as simple ASCII or binary image
19721993
files that are easy to read and write. They are not compressed, and are
19731994
not particularly efficient for large images. They are not widely used in
19741995
the professional graphics world, but because of their historical
@@ -2029,7 +2050,7 @@ attributes are supported:
20292050
example by reading from memory rather than the file system.
20302051
* - ``pnm:bigendian``
20312052
- int
2032-
- If nonzero, the PNM file is big-endian (the default is little-endian).
2053+
- If nonzero, the PNM file is big-endian (the default is little-endian).
20332054
* - ``pnm:pfmflip``
20342055
- int
20352056
- If this configuration hint is present and is zero, the automatic
@@ -2218,25 +2239,25 @@ options are supported:
22182239
* - ``raw:use_camera_wb``
22192240
- int
22202241
- If 1, use libraw's camera white balance adjustment. Takes precedence
2221-
over ``raw:use_auto_wb``, ``raw:greybox``, ``raw:user_mul``.
2242+
over ``raw:use_auto_wb``, ``raw:greybox``, ``raw:user_mul``.
22222243
(Default: 1)
22232244
* - ``raw:use_auto_wb``
22242245
- int
22252246
- If 1, white balance automatically by averaging over the entire image.
2226-
Only applies if ``raw:use_camera_wb`` is not equal to 0. Takes
2247+
Only applies if ``raw:use_camera_wb`` is not equal to 0. Takes
22272248
precedence over ``raw:greybox``, ``raw:user_mul``.
22282249
(Default: 0)
22292250
* - ``raw:greybox``
22302251
- int[4]
2231-
- White balance by averaging over the given box. The four values are the
2252+
- White balance by averaging over the given box. The four values are the
22322253
X and Y coordinate of the top-left corner, the width and the height.
2233-
Only applies if the size is non-zero, and ``raw:use_camera_wb`` is not
2234-
equal to 0, ``raw:use_auto_wb`` is not equal to 0. Takes
2254+
Only applies if the size is non-zero, and ``raw:use_camera_wb`` is not
2255+
equal to 0, ``raw:use_auto_wb`` is not equal to 0. Takes
22352256
precedence over ``raw:user_mul``.
22362257
(Default: 0, 0, 0, 0; meaning no correction.)
22372258
* - ``raw:cropbox``
22382259
- int[4]
2239-
- If present, sets the box to crop the image to. The four values are the
2260+
- If present, sets the box to crop the image to. The four values are the
22402261
X and Y coordinate of the top-left corner, the width and the height.
22412262
If not present, the image is cropped to match the in-camera JPEG,
22422263
assuming the necessary information is present in the metadata. The
@@ -2270,7 +2291,7 @@ options are supported:
22702291
* - ``raw:user_mul``
22712292
- float[4]
22722293
- Sets user white balance coefficients. Only applies if ``raw:use_camera_wb``
2273-
is not equal to 0, ``raw:use_auto_wb`` is not equal to 0, and the
2294+
is not equal to 0, ``raw:use_auto_wb`` is not equal to 0, and the
22742295
``raw:greybox`` box is zero size.
22752296
* - ``raw:ColorSpace``
22762297
- string
@@ -2315,7 +2336,7 @@ options are supported:
23152336
(Default: 2.2222222222222223 (1.0/0.45))
23162337
* - ``raw:user_flip``
23172338
- int
2318-
- Set libraw user flip value : -1 ignored, other values are between [0; 8] with the same
2339+
- Set libraw user flip value : -1 ignored, other values are between [0; 8] with the same
23192340
definition than the Exif orientation code.
23202341
* - ``raw:threshold``
23212342
- float
@@ -2352,7 +2373,7 @@ options are supported:
23522373
(Default: -1)
23532374
* - ``raw:thumbnail_sort``
23542375
- int
2355-
- Controls the sort order of the list the thumbnail gets picked from.
2376+
- Controls the sort order of the list the thumbnail gets picked from.
23562377
-1 - sort small-to-large, 0 - don't sort, use the original file order,
23572378
1 - sort large-to-small.
23582379
(Default: 0)
@@ -3271,4 +3292,3 @@ of the z-buffer. Zfile files use the file extension :file:`.zfile`.
32713292
* - ``worldtoscreen``
32723293
- matrix
32733294
- Nl
3274-

0 commit comments

Comments
 (0)