@@ -49,7 +49,6 @@ Encoding of NumPy ndarrays is supported for the following:
4949* Number of rows/columns: up to 65535
5050* Number of planes: 1, 3 or 4
5151
52-
5352### Transfer Syntaxes
5453| UID | Description |
5554| --- | --- |
@@ -95,38 +94,38 @@ Lossless encoding of RGB with multiple-component transformation:
9594``` python
9695
9796import numpy as np
98- from openjpeg import encode
97+ from openjpeg import encode_array
9998
100- arr = np.random.randint(low = 0 , high = 65535 , size = (100 , 100 , 3 ), dtype = " uint8" )
101- encode (arr, photometric_interpretation = 1 ) # 1: sRGB
99+ arr = np.random.randint(low = 0 , high = 65536 , size = (100 , 100 , 3 ), dtype = " uint8" )
100+ encode_array (arr, photometric_interpretation = 1 ) # 1: sRGB
102101```
103102
104103Lossy encoding of a monochrome image using compression ratios:
105104
106105``` python
107106
108107import numpy as np
109- from openjpeg import encode
108+ from openjpeg import encode_array
110109
111- arr = np.random.randint(low = - 2 ** 15 , high = 2 ** 15 - 1 , size = (100 , 100 ), dtype = " int8" )
110+ arr = np.random.randint(low = - 2 ** 15 , high = 2 ** 15 , size = (100 , 100 ), dtype = " int8" )
112111# You must determine your own values for `compression_ratios`
113112# as these are for illustration purposes only
114- encode (arr, compression_ratios = [2 , 4 , 6 ])
113+ encode_array (arr, compression_ratios = [5 , 2 ])
115114```
116115
117116Lossy encoding of a monochrome image using peak signal-to-noise ratios:
118117
119118``` python
120119
121120import numpy as np
122- from openjpeg import encode
121+ from openjpeg import encode_array
123122
124- arr = np.random.randint(low = - 2 ** 15 , high = 2 ** 15 - 1 , size = (100 , 100 ), dtype = " int8" )
123+ arr = np.random.randint(low = - 2 ** 15 , high = 2 ** 15 , size = (100 , 100 ), dtype = " int8" )
125124# You must determine your own values for `signal_noise_ratios`
126125# as these are for illustration purposes only
127- encode (arr, signal_noise_ratios = [50 , 80 , 100 ])
126+ encode_array (arr, signal_noise_ratios = [50 , 80 , 100 ])
128127```
129128
130- See the docstring for the [ encode () function] [ 2 ] for full details.
129+ See the docstring for the [ encode_array () function] [ 2 ] for full details.
131130
132- [ 2 ] : https://github.com/pydicom/pylibjpeg-openjpeg/blob/main/openjpeg/utils.py#L428
131+ [ 2 ] : https://github.com/pydicom/pylibjpeg-openjpeg/blob/main/openjpeg/utils.py#L429
0 commit comments