Glymur 0.14.0.post1__py3-none-any.whl → 0.14.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- glymur/_core_converter.py +3 -1
- glymur/codestream.py +1 -1
- glymur/jp2box.py +3 -1
- glymur/jp2k.py +89 -7
- glymur/jp2kr.py +110 -8
- glymur/jpeg.py +4 -2
- glymur/lib/tiff.py +4 -38
- glymur/version.py +1 -1
- {glymur-0.14.0.post1.dist-info → glymur-0.14.1.dist-info}/METADATA +16 -14
- glymur-0.14.1.dist-info/RECORD +27 -0
- {glymur-0.14.0.post1.dist-info → glymur-0.14.1.dist-info}/WHEEL +1 -1
- glymur-0.14.0.post1.dist-info/RECORD +0 -27
- {glymur-0.14.0.post1.dist-info → glymur-0.14.1.dist-info}/entry_points.txt +0 -0
- {glymur-0.14.0.post1.dist-info → glymur-0.14.1.dist-info}/licenses/LICENSE.txt +0 -0
- {glymur-0.14.0.post1.dist-info → glymur-0.14.1.dist-info}/top_level.txt +0 -0
glymur/_core_converter.py
CHANGED
|
@@ -158,7 +158,9 @@ class _2JP2Converter(object):
|
|
|
158
158
|
else:
|
|
159
159
|
payload = payload[:nvalues]
|
|
160
160
|
|
|
161
|
-
tags[tag] = {
|
|
161
|
+
tags[tag] = {
|
|
162
|
+
"dtype": dtype, "nvalues": nvalues, "payload": payload
|
|
163
|
+
}
|
|
162
164
|
|
|
163
165
|
return tags
|
|
164
166
|
|
glymur/codestream.py
CHANGED
|
@@ -1587,7 +1587,7 @@ class QCCsegment(Segment):
|
|
|
1587
1587
|
self.length = length
|
|
1588
1588
|
self.offset = offset
|
|
1589
1589
|
|
|
1590
|
-
self.mantissa, self.exponent = parse_quantization(self.spqcc, self.sqcc)
|
|
1590
|
+
self.mantissa, self.exponent = parse_quantization(self.spqcc, self.sqcc) # noqa : E501
|
|
1591
1591
|
self.guard_bits = (self.sqcc & 0xE0) >> 5
|
|
1592
1592
|
|
|
1593
1593
|
def __str__(self):
|
glymur/jp2box.py
CHANGED
|
@@ -3088,7 +3088,9 @@ class NumberListBox(Jp2kBox):
|
|
|
3088
3088
|
|
|
3089
3089
|
def write(self, fptr):
|
|
3090
3090
|
"""Write a NumberList box to file."""
|
|
3091
|
-
fptr.write(
|
|
3091
|
+
fptr.write(
|
|
3092
|
+
struct.pack(">I4s", len(self.associations) * 4 + 8, b"nlst")
|
|
3093
|
+
)
|
|
3092
3094
|
|
|
3093
3095
|
fmt = ">" + "I" * len(self.associations)
|
|
3094
3096
|
write_buffer = struct.pack(fmt, *self.associations)
|
glymur/jp2k.py
CHANGED
|
@@ -168,7 +168,7 @@ class Jp2k(Jp2kr):
|
|
|
168
168
|
self._psnr = psnr
|
|
169
169
|
self._sop = sop
|
|
170
170
|
self._subsam = subsam
|
|
171
|
-
self.
|
|
171
|
+
self._tilesize_w = tilesize
|
|
172
172
|
self._tlm = tlm
|
|
173
173
|
self._verbose = verbose
|
|
174
174
|
|
|
@@ -323,7 +323,7 @@ class Jp2k(Jp2kr):
|
|
|
323
323
|
|
|
324
324
|
if (
|
|
325
325
|
self._shape is not None
|
|
326
|
-
and self.
|
|
326
|
+
and self._tilesize_w is not None
|
|
327
327
|
and (
|
|
328
328
|
self.tilesize[0] > self.shape[0]
|
|
329
329
|
or self.tilesize[1] > self.shape[1]
|
|
@@ -336,7 +336,30 @@ class Jp2k(Jp2kr):
|
|
|
336
336
|
raise RuntimeError(msg)
|
|
337
337
|
|
|
338
338
|
def get_tilewriters(self):
|
|
339
|
-
"""Return an object that facilitates writing tile by tile.
|
|
339
|
+
"""Return an object that facilitates writing tile by tile.
|
|
340
|
+
|
|
341
|
+
The tiles are written out left-to-right, tile-row-by-tile-row.
|
|
342
|
+
You must have image data ready to feed each tile writer, and you
|
|
343
|
+
cannot skip a tile.
|
|
344
|
+
|
|
345
|
+
You can use this method to write extremely large images that cannot
|
|
346
|
+
fit into memory, tile by tile.
|
|
347
|
+
|
|
348
|
+
Examples
|
|
349
|
+
--------
|
|
350
|
+
>>> import skimage.data
|
|
351
|
+
>>> img = skimage.data.moon()
|
|
352
|
+
>>> print(img.shape)
|
|
353
|
+
(512, 512)
|
|
354
|
+
>>> shape = img.shape[0] * 2, img.shape[1] * 2
|
|
355
|
+
>>> tilesize = (img.shape[0], img.shape[1])
|
|
356
|
+
>>> j = Jp2k('moon-4.jp2', shape=shape, tilesize=tilesize)
|
|
357
|
+
>>> for tw in j.get_tilewriters():
|
|
358
|
+
... tw[:] = img
|
|
359
|
+
>>> j = Jp2kr('moon-4.jp2')
|
|
360
|
+
>>> print(j.shape)
|
|
361
|
+
(1024, 1024)
|
|
362
|
+
"""
|
|
340
363
|
|
|
341
364
|
if self.shape[:2] == self.tilesize:
|
|
342
365
|
msg = (
|
|
@@ -458,9 +481,9 @@ class Jp2k(Jp2kr):
|
|
|
458
481
|
cparams.subsampling_dy = self._subsam[0]
|
|
459
482
|
cparams.subsampling_dx = self._subsam[1]
|
|
460
483
|
|
|
461
|
-
if self.
|
|
462
|
-
cparams.cp_tdx = self.
|
|
463
|
-
cparams.cp_tdy = self.
|
|
484
|
+
if self._tilesize_w is not None:
|
|
485
|
+
cparams.cp_tdx = self.tilesize[1]
|
|
486
|
+
cparams.cp_tdy = self.tilesize[0]
|
|
464
487
|
cparams.tile_size_on = opj2.TRUE
|
|
465
488
|
|
|
466
489
|
if self._mct is None:
|
|
@@ -715,6 +738,48 @@ class Jp2k(Jp2kr):
|
|
|
715
738
|
----------
|
|
716
739
|
box : Jp2Box
|
|
717
740
|
Instance of a JP2 box.
|
|
741
|
+
|
|
742
|
+
Examples
|
|
743
|
+
--------
|
|
744
|
+
>>> import io, shutil, lxml.etree as ET
|
|
745
|
+
>>> _ = shutil.copyfile(glymur.data.nemo(), 'new-nemo.jp2')
|
|
746
|
+
>>> j = glymur.Jp2k('new-nemo.jp2')
|
|
747
|
+
>>> b = io.BytesIO(b'''
|
|
748
|
+
... <info>
|
|
749
|
+
... <city>Nashville</city>
|
|
750
|
+
... <city>Knoxville</city>
|
|
751
|
+
... <city>Whoville</city>
|
|
752
|
+
... </info>
|
|
753
|
+
... ''')
|
|
754
|
+
>>> doc = ET.parse(b)
|
|
755
|
+
>>> xmlbox = glymur.jp2box.XMLBox(xml=doc)
|
|
756
|
+
>>> j.append(xmlbox)
|
|
757
|
+
>>> glymur.set_option('print.codestream', False)
|
|
758
|
+
>>> print(j)
|
|
759
|
+
File: new-nemo.jp2
|
|
760
|
+
JPEG 2000 Signature Box (jP ) @ (0, 12)
|
|
761
|
+
Signature: 0d0a870a
|
|
762
|
+
File Type Box (ftyp) @ (12, 20)
|
|
763
|
+
Brand: jp2
|
|
764
|
+
Compatibility: ['jp2 ']
|
|
765
|
+
JP2 Header Box (jp2h) @ (32, 45)
|
|
766
|
+
Image Header Box (ihdr) @ (40, 22)
|
|
767
|
+
Size: [1456 2592 3]
|
|
768
|
+
Bitdepth: 8
|
|
769
|
+
Signed: False
|
|
770
|
+
Compression: wavelet
|
|
771
|
+
Colorspace Unknown: False
|
|
772
|
+
Colour Specification Box (colr) @ (62, 15)
|
|
773
|
+
Method: enumerated colorspace
|
|
774
|
+
Precedence: 0
|
|
775
|
+
Colorspace: sRGB
|
|
776
|
+
Contiguous Codestream Box (jp2c) @ (77, 1132296)
|
|
777
|
+
XML Box (xml ) @ (1132373, 102)
|
|
778
|
+
<info>
|
|
779
|
+
<city>Nashville</city>
|
|
780
|
+
<city>Knoxville</city>
|
|
781
|
+
<city>Whoville</city>
|
|
782
|
+
</info>
|
|
718
783
|
"""
|
|
719
784
|
if self._codec_format == opj2.CODEC_J2K:
|
|
720
785
|
msg = "You cannot append to a J2K file (raw codestream)."
|
|
@@ -761,7 +826,9 @@ class Jp2k(Jp2kr):
|
|
|
761
826
|
This method is primarily aimed at wrapping a raw codestream in a set of
|
|
762
827
|
of JP2 boxes (turning it into a JP2 file instead of just a raw
|
|
763
828
|
codestream), or rewrapping a codestream in a JP2 file in a new "jacket"
|
|
764
|
-
of JP2 boxes.
|
|
829
|
+
of JP2 boxes. Wrapping a raw codestream preserves the internal
|
|
830
|
+
structure of the codestream, whereas simply writing it back out by
|
|
831
|
+
invoking the Jp2k constructor might rewrite the internal structure.
|
|
765
832
|
|
|
766
833
|
Parameters
|
|
767
834
|
----------
|
|
@@ -778,6 +845,21 @@ class Jp2k(Jp2kr):
|
|
|
778
845
|
-------
|
|
779
846
|
Jp2k
|
|
780
847
|
Newly wrapped Jp2k object.
|
|
848
|
+
|
|
849
|
+
Examples
|
|
850
|
+
--------
|
|
851
|
+
|
|
852
|
+
>>> j2c = glymur.Jp2k(glymur.data.goodstuff())
|
|
853
|
+
>>> jp2 = j2c.wrap('new-goodstuff.jp2')
|
|
854
|
+
>>> glymur.set_option('print.short', True)
|
|
855
|
+
>>> print(jp2)
|
|
856
|
+
File: new-goodstuff.jp2
|
|
857
|
+
JPEG 2000 Signature Box (jP ) @ (0, 12)
|
|
858
|
+
File Type Box (ftyp) @ (12, 20)
|
|
859
|
+
JP2 Header Box (jp2h) @ (32, 45)
|
|
860
|
+
Image Header Box (ihdr) @ (40, 22)
|
|
861
|
+
Colour Specification Box (colr) @ (62, 15)
|
|
862
|
+
Contiguous Codestream Box (jp2c) @ (77, 115228)
|
|
781
863
|
"""
|
|
782
864
|
if boxes is None:
|
|
783
865
|
boxes = self._get_default_jp2_boxes()
|
glymur/jp2kr.py
CHANGED
|
@@ -102,6 +102,7 @@ class Jp2kr(Jp2kBox):
|
|
|
102
102
|
self._ndim = None
|
|
103
103
|
self._parse_count = 0
|
|
104
104
|
self._verbose = verbose
|
|
105
|
+
self._tilesize_r = None
|
|
105
106
|
|
|
106
107
|
if not self.path.exists():
|
|
107
108
|
raise FileNotFoundError(f"{self.filename} does not exist.")
|
|
@@ -146,7 +147,23 @@ class Jp2kr(Jp2kBox):
|
|
|
146
147
|
@property
|
|
147
148
|
def ignore_pclr_cmap_cdef(self):
|
|
148
149
|
"""If true, ignore the pclr, cmap, or cdef boxes during any
|
|
149
|
-
color transformation.
|
|
150
|
+
color transformation. Why would you wish to do that? In the immortal
|
|
151
|
+
words of Critical Drinker, don't know!
|
|
152
|
+
|
|
153
|
+
Defaults to false.
|
|
154
|
+
|
|
155
|
+
Examples
|
|
156
|
+
--------
|
|
157
|
+
>>> from glymur import Jp2kr
|
|
158
|
+
>>> jpxfile = glymur.data.jpxfile()
|
|
159
|
+
>>> j = Jp2kr(jpxfile)
|
|
160
|
+
>>> d = j[:]
|
|
161
|
+
>>> print(d.shape)
|
|
162
|
+
(1024, 1024, 3)
|
|
163
|
+
>>> j.ignore_pclr_cmap_cdef = True
|
|
164
|
+
>>> d = j[:]
|
|
165
|
+
>>> print(d.shape)
|
|
166
|
+
(1024, 1024)
|
|
150
167
|
"""
|
|
151
168
|
return self._ignore_pclr_cmap_cdef
|
|
152
169
|
|
|
@@ -158,6 +175,18 @@ class Jp2kr(Jp2kBox):
|
|
|
158
175
|
def decoded_components(self):
|
|
159
176
|
"""If true, decode only these components. The MCT will not be used.
|
|
160
177
|
List or scalar or None (default).
|
|
178
|
+
|
|
179
|
+
Examples
|
|
180
|
+
--------
|
|
181
|
+
>>> from glymur import Jp2kr
|
|
182
|
+
>>> j = Jp2kr(glymur.data.nemo())
|
|
183
|
+
>>> rgb = j[:]
|
|
184
|
+
>>> print(rgb.shape)
|
|
185
|
+
(1456, 2592, 3)
|
|
186
|
+
>>> j.decoded_components = 0
|
|
187
|
+
>>> comp0 = j[:]
|
|
188
|
+
>>> print(comp0.shape)
|
|
189
|
+
(1456, 2592)
|
|
161
190
|
"""
|
|
162
191
|
return self._decoded_components
|
|
163
192
|
|
|
@@ -215,7 +244,17 @@ class Jp2kr(Jp2kBox):
|
|
|
215
244
|
|
|
216
245
|
@property
|
|
217
246
|
def dtype(self):
|
|
218
|
-
"""Datatype of the image.
|
|
247
|
+
"""Datatype of the image.
|
|
248
|
+
|
|
249
|
+
Examples
|
|
250
|
+
--------
|
|
251
|
+
>>> from glymur import Jp2kr
|
|
252
|
+
>>> jp2file = glymur.data.nemo()
|
|
253
|
+
>>> j = Jp2kr(jp2file)
|
|
254
|
+
>>> j.dtype
|
|
255
|
+
<class 'numpy.uint8'>
|
|
256
|
+
"""
|
|
257
|
+
|
|
219
258
|
if self._dtype is None:
|
|
220
259
|
c = self.get_codestream()
|
|
221
260
|
bps0 = c.segment[1].bitdepth[0]
|
|
@@ -242,25 +281,77 @@ class Jp2kr(Jp2kBox):
|
|
|
242
281
|
|
|
243
282
|
@property
|
|
244
283
|
def ndim(self):
|
|
245
|
-
"""Number of image dimensions.
|
|
284
|
+
"""Number of image dimensions.
|
|
285
|
+
|
|
286
|
+
Examples
|
|
287
|
+
--------
|
|
288
|
+
>>> from glymur import Jp2kr
|
|
289
|
+
>>> jp2file = glymur.data.nemo()
|
|
290
|
+
>>> j = Jp2kr(jp2file)
|
|
291
|
+
>>> j.ndim
|
|
292
|
+
3
|
|
293
|
+
"""
|
|
246
294
|
return len(self.shape)
|
|
247
295
|
|
|
248
296
|
@property
|
|
249
297
|
def codestream(self):
|
|
250
|
-
"""Metadata for JP2 or J2K codestream header.
|
|
298
|
+
"""Metadata for JP2 or J2K codestream header.
|
|
299
|
+
|
|
300
|
+
Examples
|
|
301
|
+
--------
|
|
302
|
+
>>> from glymur import Jp2kr
|
|
303
|
+
>>> jp2file = glymur.data.nemo()
|
|
304
|
+
>>> c = Jp2kr(jp2file).codestream
|
|
305
|
+
>>> print(c.segment[0])
|
|
306
|
+
SOC marker segment @ (85, 0)
|
|
307
|
+
>>> len(c.segment)
|
|
308
|
+
5
|
|
309
|
+
"""
|
|
251
310
|
if self._codestream is None:
|
|
252
311
|
self._codestream = self.get_codestream(header_only=True)
|
|
253
312
|
return self._codestream
|
|
254
313
|
|
|
255
314
|
@property
|
|
256
315
|
def tilesize(self):
|
|
257
|
-
"""Height and width of the image tiles.
|
|
258
|
-
|
|
316
|
+
"""Height and width of the image tiles.
|
|
317
|
+
|
|
318
|
+
Examples
|
|
319
|
+
--------
|
|
320
|
+
>>> jp = glymur.Jp2kr(glymur.data.nemo())
|
|
321
|
+
>>> print(jp.shape)
|
|
322
|
+
(1456, 2592, 3)
|
|
323
|
+
>>> print(jp.tilesize)
|
|
324
|
+
(1456, 2592)
|
|
325
|
+
"""
|
|
326
|
+
|
|
327
|
+
if not hasattr(self, '_tilesize_w') and self._tilesize_r is None:
|
|
328
|
+
# file was opened as read-only case
|
|
329
|
+
segment = self.codestream.segment[1]
|
|
330
|
+
tilesize = segment.ytsiz, segment.xtsiz
|
|
331
|
+
elif self._tilesize_w is None:
|
|
332
|
+
# read-write case, but we are reading not writing
|
|
333
|
+
segment = self.codestream.segment[1]
|
|
334
|
+
tilesize = segment.ytsiz, segment.xtsiz
|
|
335
|
+
else:
|
|
336
|
+
# write-only case
|
|
337
|
+
tilesize = self._tilesize_w
|
|
338
|
+
|
|
339
|
+
return tilesize
|
|
259
340
|
|
|
260
341
|
@property
|
|
261
342
|
def verbose(self):
|
|
262
343
|
"""If true, print informational messages produced by the
|
|
263
344
|
OpenJPEG library. Defaults to false.
|
|
345
|
+
|
|
346
|
+
Examples
|
|
347
|
+
--------
|
|
348
|
+
>>> import skimage
|
|
349
|
+
>>> j = glymur.Jp2k('moon.jp2', tilesize=[256, 256], verbose=True)
|
|
350
|
+
>>> j[:] = skimage.data.moon()
|
|
351
|
+
[INFO] tile number 1 / 4
|
|
352
|
+
[INFO] tile number 2 / 4
|
|
353
|
+
[INFO] tile number 3 / 4
|
|
354
|
+
[INFO] tile number 4 / 4
|
|
264
355
|
"""
|
|
265
356
|
return self._verbose
|
|
266
357
|
|
|
@@ -270,7 +361,14 @@ class Jp2kr(Jp2kBox):
|
|
|
270
361
|
|
|
271
362
|
@property
|
|
272
363
|
def shape(self):
|
|
273
|
-
"""Dimensions of full resolution image.
|
|
364
|
+
"""Dimensions of full resolution image.
|
|
365
|
+
|
|
366
|
+
Examples
|
|
367
|
+
--------
|
|
368
|
+
>>> jp = glymur.Jp2kr(glymur.data.nemo())
|
|
369
|
+
>>> print(jp.shape)
|
|
370
|
+
(1456, 2592, 3)
|
|
371
|
+
"""
|
|
274
372
|
return self._shape
|
|
275
373
|
|
|
276
374
|
@shape.setter
|
|
@@ -919,7 +1017,7 @@ class Jp2kr(Jp2kBox):
|
|
|
919
1017
|
--------
|
|
920
1018
|
>>> jfile = glymur.data.nemo()
|
|
921
1019
|
>>> jp2 = glymur.Jp2k(jfile)
|
|
922
|
-
>>> codestream = jp2.get_codestream()
|
|
1020
|
+
>>> codestream = jp2.get_codestream(header_only=False)
|
|
923
1021
|
>>> print(codestream.segment[1])
|
|
924
1022
|
SIZ marker segment @ (87, 47)
|
|
925
1023
|
Profile: no profile
|
|
@@ -930,6 +1028,10 @@ class Jp2kr(Jp2kBox):
|
|
|
930
1028
|
Bitdepth: (8, 8, 8)
|
|
931
1029
|
Signed: (False, False, False)
|
|
932
1030
|
Vertical, Horizontal Subsampling: ((1, 1), (1, 1), (1, 1))
|
|
1031
|
+
>>> print(len(codestream.segment))
|
|
1032
|
+
12
|
|
1033
|
+
>>> print(codestream.segment[-1])
|
|
1034
|
+
EOC marker segment @ (1132371, 0)
|
|
933
1035
|
"""
|
|
934
1036
|
with self.path.open("rb") as fptr:
|
|
935
1037
|
|
glymur/jpeg.py
CHANGED
|
@@ -6,7 +6,8 @@ import struct
|
|
|
6
6
|
from typing import Tuple
|
|
7
7
|
|
|
8
8
|
# 3rd party library imports
|
|
9
|
-
import
|
|
9
|
+
import numpy as np
|
|
10
|
+
from PIL import Image
|
|
10
11
|
|
|
11
12
|
# local imports
|
|
12
13
|
from .jp2k import Jp2k
|
|
@@ -185,7 +186,8 @@ class JPEG2JP2(_2JP2Converter):
|
|
|
185
186
|
|
|
186
187
|
def copy_image(self):
|
|
187
188
|
"""Transfer the image data from the JPEG to the JP2 file."""
|
|
188
|
-
|
|
189
|
+
with Image.open(self.jpeg_path) as im:
|
|
190
|
+
image = np.array(im)
|
|
189
191
|
|
|
190
192
|
self.jp2 = Jp2k(
|
|
191
193
|
self.jp2_path,
|
glymur/lib/tiff.py
CHANGED
|
@@ -111,43 +111,7 @@ class Orientation(IntEnum):
|
|
|
111
111
|
|
|
112
112
|
|
|
113
113
|
class Photometric(IntEnum):
|
|
114
|
-
"""The color space of the image data.
|
|
115
|
-
|
|
116
|
-
Examples
|
|
117
|
-
--------
|
|
118
|
-
|
|
119
|
-
Load an image of astronaut Eileen Collins from scikit-image.
|
|
120
|
-
|
|
121
|
-
>>> import numpy as np
|
|
122
|
-
>>> import skimage.data
|
|
123
|
-
>>> image = skimage.data.astronaut()
|
|
124
|
-
|
|
125
|
-
Create a BigTIFF with JPEG compression. There is not much reason to do
|
|
126
|
-
this if you do not also specify YCbCr as the photometric interpretation.
|
|
127
|
-
|
|
128
|
-
>>> w, h, nz = image.shape
|
|
129
|
-
>>> tw, th = w // 2, h // 2
|
|
130
|
-
>>> from glymur.lib import tiff as libtiff
|
|
131
|
-
>>> fp = libtiff.open('astronaut-jpeg.tif', mode='w8')
|
|
132
|
-
>>> libtiff.setField(fp, 'Photometric', libtiff.Photometric.YCBCR)
|
|
133
|
-
>>> libtiff.setField(fp, 'Compression', libtiff.Compression.JPEG)
|
|
134
|
-
>>> libtiff.setField(fp, 'JPEGColorMode', libtiff.JPEGColorMode.RGB)
|
|
135
|
-
>>> libtiff.setField(fp, 'PlanarConfig', libtiff.PlanarConfig.CONTIG)
|
|
136
|
-
>>> libtiff.setField(fp, 'JPEGQuality', 90)
|
|
137
|
-
>>> libtiff.setField(fp, 'YCbCrSubsampling', 1, 1)
|
|
138
|
-
>>> libtiff.setField(fp, 'ImageWidth', w)
|
|
139
|
-
>>> libtiff.setField(fp, 'ImageLength', h)
|
|
140
|
-
>>> libtiff.setField(fp, 'TileWidth', tw)
|
|
141
|
-
>>> libtiff.setField(fp, 'TileLength', th)
|
|
142
|
-
>>> libtiff.setField(fp, 'BitsPerSample', 8)
|
|
143
|
-
>>> libtiff.setField(fp, 'SamplesPerPixel', nz)
|
|
144
|
-
>>> libtiff.setField(fp, 'Software', libtiff.getVersion())
|
|
145
|
-
>>> libtiff.writeEncodedTile(fp, 0, image[:th, :tw].copy())
|
|
146
|
-
>>> libtiff.writeEncodedTile(fp, 1, image[:th, tw:w].copy())
|
|
147
|
-
>>> libtiff.writeEncodedTile(fp, 2, image[th:h, :tw].copy())
|
|
148
|
-
>>> libtiff.writeEncodedTile(fp, 3, image[th:h, tw:w].copy())
|
|
149
|
-
>>> libtiff.close(fp)
|
|
150
|
-
"""
|
|
114
|
+
"""The color space of the image data."""
|
|
151
115
|
|
|
152
116
|
MINISWHITE = 0 # value is white
|
|
153
117
|
MINISBLACK = 1 # value is black
|
|
@@ -2130,7 +2094,9 @@ class _Ifd(object):
|
|
|
2130
2094
|
# tuple.
|
|
2131
2095
|
payload = payload[0]
|
|
2132
2096
|
else:
|
|
2133
|
-
payload = np.array(
|
|
2097
|
+
payload = np.array(
|
|
2098
|
+
payload, dtype=DATATYPE2FMT[dtype]["nptype"]
|
|
2099
|
+
)
|
|
2134
2100
|
|
|
2135
2101
|
return payload
|
|
2136
2102
|
|
glymur/version.py
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: Glymur
|
|
3
|
-
Version: 0.14.
|
|
4
|
-
|
|
5
|
-
Author:
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
Version: 0.14.1
|
|
4
|
+
Summary: Read and write JPEG 2000 files
|
|
5
|
+
Author-email: John Evans <jevans667cc@proton.me>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://glymur.readthedocs.io
|
|
8
|
+
Project-URL: Documentation, https://glymur.readthedocs.io
|
|
9
|
+
Project-URL: Repository, https://github.com/quintusdias/glymur
|
|
10
|
+
Keywords: JPEG2000,JPEG,2000,imagery
|
|
8
11
|
Classifier: Programming Language :: Python
|
|
9
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
10
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
11
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
12
15
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
16
|
Classifier: Intended Audience :: Science/Research
|
|
15
17
|
Classifier: Operating System :: OS Independent
|
|
16
18
|
Classifier: Topic :: Scientific/Engineering
|
|
17
|
-
Requires-Python: >=3.
|
|
19
|
+
Requires-Python: >=3.11
|
|
18
20
|
Description-Content-Type: text/markdown
|
|
19
21
|
License-File: LICENSE.txt
|
|
20
22
|
Requires-Dist: numpy
|
|
21
23
|
Requires-Dist: lxml
|
|
22
|
-
Requires-Dist:
|
|
23
|
-
Requires-Dist: packaging
|
|
24
|
-
Provides-Extra: test
|
|
25
|
-
Requires-Dist: pytest; extra == "test"
|
|
26
|
-
Requires-Dist: pillow; extra == "test"
|
|
27
|
-
Requires-Dist: scikit-image; extra == "test"
|
|
24
|
+
Requires-Dist: PIL
|
|
28
25
|
Dynamic: license-file
|
|
29
26
|
|
|
27
|
+
glymur: a Python interface for JPEG 2000
|
|
28
|
+
=========================================
|
|
30
29
|
|
|
31
30
|
**glymur** contains a Python interface to the OpenJPEG library which
|
|
32
|
-
allows one to read and write JPEG 2000 files.
|
|
31
|
+
allows one to read and write JPEG 2000 files. **glymur** works on
|
|
32
|
+
Python 3.11, 3.12, and 3.13.
|
|
33
|
+
|
|
34
|
+
Please read the docs, https://glymur.readthedocs.org/en/latest/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
glymur/__init__.py,sha256=8kFoLkxAFhVEsgR0WCEaF0iXE5GZSp47nPlheGMpP-c,625
|
|
2
|
+
glymur/_core_converter.py,sha256=tOCxgbZReS47vyCNrfFYaEM9hM9U6ei-PvQdwFXY5mk,13042
|
|
3
|
+
glymur/_iccprofile.py,sha256=v0nOhJuZsKViBUYCf8TWVJvs1k0vC9PGYdbkEIfGuI4,4156
|
|
4
|
+
glymur/codestream.py,sha256=JQUVS8nENdf-rgMDuGwsrg0UakhN_kIShfZEzIV7IT4,62695
|
|
5
|
+
glymur/command_line.py,sha256=3Wngx3wfAvP2PEf4-XRbmm43Bz8zywIL3Gd-6k-wMvY,11485
|
|
6
|
+
glymur/config.py,sha256=lVunNA-A475BX27L_qmrec_lm1InzHuL4_jkG8v_1FA,4140
|
|
7
|
+
glymur/core.py,sha256=O07TfaRW2YmurkFMiurl0DkDSGB0slDAAzP83K1HPFA,3613
|
|
8
|
+
glymur/jp2box.py,sha256=9tBCbLqqwO-CP587a_dAW88W3MJLJMz-cAyQ_LSUO6A,113852
|
|
9
|
+
glymur/jp2k.py,sha256=Mv6i__DJ_WUTBcAXCP6wYIMBSCmnNL84H6hr0V7jSZo,56892
|
|
10
|
+
glymur/jp2kr.py,sha256=lytdX28iZIq8tyXyAWLR_jUZuO2RsKWSIXKiRpCLaqA,35882
|
|
11
|
+
glymur/jpeg.py,sha256=PSsyv4ZQTMXGQnpX9Y5-JGxHa0t6QZPZvd5BsnOhahQ,5560
|
|
12
|
+
glymur/options.py,sha256=TZApl6r_qCERHSIcTdM0iGvYuQLrZMbOtyFJB7XkvK0,4413
|
|
13
|
+
glymur/tiff.py,sha256=5oBeNwaMgojb0mfZJpk86WYHdrR04QRdfW2QDX1I7CU,29550
|
|
14
|
+
glymur/version.py,sha256=ztgCvK_1HaxdLnoa8JOrO4YDlBwYdrFsGg1qXTtU9Xk,981
|
|
15
|
+
glymur/data/__init__.py,sha256=n2KZrHV15it7Wu4YCaBLXui1ZleQ30dnZ92dyP6q05k,955
|
|
16
|
+
glymur/data/goodstuff.j2k,sha256=xKQG68KMu33gYjRUDTQvam1Cue2tdio85rNp5J-rYZE,115220
|
|
17
|
+
glymur/data/heliov.jpx,sha256=KXnYdBZgl25jcGLu-m-QfhuP9pqUXV0Hp9HHEdJqr34,1399071
|
|
18
|
+
glymur/data/nemo.jp2,sha256=yJ1NkTEwU0B_gBtAiA1c5hxtGYSJtJgq6cHC2IHpj70,1132373
|
|
19
|
+
glymur/lib/__init__.py,sha256=JnM9oPfcZhBDLKo7_yLS-lIRQ1wXb1N9hKKQ-G7vYVk,127
|
|
20
|
+
glymur/lib/openjp2.py,sha256=0UWPp2mto8G43yRUhGfpcS1RV6l3ac1YQrlVyBhxvjs,44064
|
|
21
|
+
glymur/lib/tiff.py,sha256=t8XfgwX2jX0qSU8RuTkNvWLe2390Bp7TiVlr8K2Ku68,51828
|
|
22
|
+
glymur-0.14.1.dist-info/licenses/LICENSE.txt,sha256=G9pvBgkJdPTtZqQmoRyIgAydtic1ZwWtOWBea9VMW7I,1077
|
|
23
|
+
glymur-0.14.1.dist-info/METADATA,sha256=kZ22Yu2J0H3P3IWvEfA174L3wQb27tVoH5e62GZc-FI,1271
|
|
24
|
+
glymur-0.14.1.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
25
|
+
glymur-0.14.1.dist-info/entry_points.txt,sha256=v_9O2V_6M5ir6_nYmtkpgY9QvN1H-CMVg6tKqcUN4v0,133
|
|
26
|
+
glymur-0.14.1.dist-info/top_level.txt,sha256=D0SvtBUoPxOs40OTRW3l-kjGFHM6VrXS8yZPK5Fx2wY,7
|
|
27
|
+
glymur-0.14.1.dist-info/RECORD,,
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
glymur/__init__.py,sha256=8kFoLkxAFhVEsgR0WCEaF0iXE5GZSp47nPlheGMpP-c,625
|
|
2
|
-
glymur/_core_converter.py,sha256=sfb0EOjSY2RFI4qhmz5t2UlsP68pibcyCieJTAMMFRc,13012
|
|
3
|
-
glymur/_iccprofile.py,sha256=v0nOhJuZsKViBUYCf8TWVJvs1k0vC9PGYdbkEIfGuI4,4156
|
|
4
|
-
glymur/codestream.py,sha256=wzRI8S5dlNfg6RqrSV7r5a4Rr2cDfk0n7CvytonBmHk,62680
|
|
5
|
-
glymur/command_line.py,sha256=3Wngx3wfAvP2PEf4-XRbmm43Bz8zywIL3Gd-6k-wMvY,11485
|
|
6
|
-
glymur/config.py,sha256=lVunNA-A475BX27L_qmrec_lm1InzHuL4_jkG8v_1FA,4140
|
|
7
|
-
glymur/core.py,sha256=O07TfaRW2YmurkFMiurl0DkDSGB0slDAAzP83K1HPFA,3613
|
|
8
|
-
glymur/jp2box.py,sha256=eSu9D_Lisawp4Z3UOxNLGVjDgTTn59s_XNkqTFYOg9Y,113829
|
|
9
|
-
glymur/jp2k.py,sha256=TmlfUsrRGcTD8gh-CxEUdc65tCSo2s0MGXzWShb01BQ,53888
|
|
10
|
-
glymur/jp2kr.py,sha256=DK4AQSc_30C1ZDAnxZubmZ6HBE1OwFj3VKpRg48wkVw,33143
|
|
11
|
-
glymur/jpeg.py,sha256=J8BBcQnVd9EVKlLE8f1uhOhHc9RiDJZkw5-Ul1UJr4Q,5507
|
|
12
|
-
glymur/options.py,sha256=TZApl6r_qCERHSIcTdM0iGvYuQLrZMbOtyFJB7XkvK0,4413
|
|
13
|
-
glymur/tiff.py,sha256=5oBeNwaMgojb0mfZJpk86WYHdrR04QRdfW2QDX1I7CU,29550
|
|
14
|
-
glymur/version.py,sha256=BhHULLp19YuFJ3c4C_vJcgRJbihjEzIHuIdAXAA9j2U,986
|
|
15
|
-
glymur/data/__init__.py,sha256=n2KZrHV15it7Wu4YCaBLXui1ZleQ30dnZ92dyP6q05k,955
|
|
16
|
-
glymur/data/goodstuff.j2k,sha256=xKQG68KMu33gYjRUDTQvam1Cue2tdio85rNp5J-rYZE,115220
|
|
17
|
-
glymur/data/heliov.jpx,sha256=KXnYdBZgl25jcGLu-m-QfhuP9pqUXV0Hp9HHEdJqr34,1399071
|
|
18
|
-
glymur/data/nemo.jp2,sha256=yJ1NkTEwU0B_gBtAiA1c5hxtGYSJtJgq6cHC2IHpj70,1132373
|
|
19
|
-
glymur/lib/__init__.py,sha256=JnM9oPfcZhBDLKo7_yLS-lIRQ1wXb1N9hKKQ-G7vYVk,127
|
|
20
|
-
glymur/lib/openjp2.py,sha256=0UWPp2mto8G43yRUhGfpcS1RV6l3ac1YQrlVyBhxvjs,44064
|
|
21
|
-
glymur/lib/tiff.py,sha256=Kf9VK7jD82SdbYVqOAOM4mQNfL2e8CHijls9Ks4gNdM,53336
|
|
22
|
-
glymur-0.14.0.post1.dist-info/licenses/LICENSE.txt,sha256=G9pvBgkJdPTtZqQmoRyIgAydtic1ZwWtOWBea9VMW7I,1077
|
|
23
|
-
glymur-0.14.0.post1.dist-info/METADATA,sha256=orxhgTmLjn6E0imR3O40ZZzp_evCDk2UV2ZnP3ehArU,1114
|
|
24
|
-
glymur-0.14.0.post1.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
25
|
-
glymur-0.14.0.post1.dist-info/entry_points.txt,sha256=v_9O2V_6M5ir6_nYmtkpgY9QvN1H-CMVg6tKqcUN4v0,133
|
|
26
|
-
glymur-0.14.0.post1.dist-info/top_level.txt,sha256=D0SvtBUoPxOs40OTRW3l-kjGFHM6VrXS8yZPK5Fx2wY,7
|
|
27
|
-
glymur-0.14.0.post1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|