Fixed write example so as to not rely on matplotlib.
This commit is contained in:
parent
86e024b081
commit
9a77cfac97
2 changed files with 6 additions and 8 deletions
|
|
@ -0,0 +1 @@
|
|||
May 27, 2013 - Changed write example to not rely on matplotlib.
|
||||
|
|
@ -194,16 +194,13 @@ class Jp2k(Jp2kBox):
|
|||
|
||||
Examples
|
||||
--------
|
||||
>>> import numpy as np
|
||||
>>> import matplotlib as mpl
|
||||
>>> import matplotlib.pyplot as plt
|
||||
>>> import os
|
||||
>>> file = os.path.join(mpl.get_data_path(), 'sample_data', 'lena.png')
|
||||
>>> data = plt.imread(file)
|
||||
>>> data = data * 255
|
||||
>>> import glymur
|
||||
>>> import pkg_resources as pkg
|
||||
>>> jfile = pkg.resource_filename(glymur.__name__, "data/nemo.jp2")
|
||||
>>> jp2 = glymur.Jp2k(jfile)
|
||||
>>> data = jp2.read(reduce=3)
|
||||
>>> from tempfile import NamedTemporaryFile
|
||||
>>> tfile = NamedTemporaryFile(suffix='.jp2', delete=False)
|
||||
>>> from glymur import Jp2k
|
||||
>>> j = Jp2k(tfile.name, mode='wb')
|
||||
>>> j.write(data.astype(np.uint8))
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue