progress
This commit is contained in:
parent
5e8a66c38e
commit
3f7c08739c
9 changed files with 117 additions and 185 deletions
|
|
@ -25,16 +25,14 @@ features such as quality layers.
|
|||
|
||||
... write images?
|
||||
=================
|
||||
So long as the image data can fit entirely into memory, array-style slicing may
|
||||
also be used to write JPEG 2000 files.
|
||||
It's pretty simple, just supply the image data as the 2nd argument to the Jp2k
|
||||
constructor.
|
||||
|
||||
>>> import glymur, numpy as np
|
||||
>>> jp2 = glymur.Jp2k('zeros.jp2', mode='wb')
|
||||
>>> jp2[:] = np.zeros((640, 480), dtype=np.uint8)
|
||||
>>> data = np.zeros((640, 480), dtype=np.uint8)
|
||||
>>> jp2 = glymur.Jp2k('zeros.jp2', data=data)
|
||||
|
||||
The :py:meth:`write` method exposes many more options for other JPEG 2000
|
||||
features. You should have OpenJPEG version 1.5 or more recent before writing
|
||||
JPEG 2000 images.
|
||||
You should have OpenJPEG version 1.5 or more recent before writing JPEG 2000 images.
|
||||
|
||||
... display metadata?
|
||||
=====================
|
||||
|
|
@ -354,15 +352,14 @@ image isn't square. ::
|
|||
>>> import numpy as np
|
||||
>>> import glymur
|
||||
>>> from glymur import Jp2k
|
||||
>>> rgb = Jp2k(glymur.data.goodstuff()).read()
|
||||
>>> rgb = Jp2k(glymur.data.goodstuff())[:]
|
||||
>>> lx, ly = rgb.shape[0:2]
|
||||
>>> X, Y = np.ogrid[0:lx, 0:ly]
|
||||
>>> mask = ly**2*(X - lx / 2) ** 2 + lx**2*(Y - ly / 2) ** 2 > (lx * ly / 2)**2
|
||||
>>> alpha = 255 * np.ones((lx, ly, 1), dtype=np.uint8)
|
||||
>>> alpha[mask] = 0
|
||||
>>> rgba = np.concatenate((rgb, alpha), axis=2)
|
||||
>>> jp2 = Jp2k('tmp.jp2', 'wb')
|
||||
>>> jp2[:] = rgba
|
||||
>>> jp2 = Jp2k('tmp.jp2', data=rgba)
|
||||
|
||||
Next we need to specify what types of channels we have.
|
||||
The first three channels are color channels, but we identify the fourth as
|
||||
|
|
@ -465,8 +462,7 @@ http://photojournal.jpl.nasa.gov/tiff/PIA17145.tif info JPEG 2000::
|
|||
>>> import skimage.io
|
||||
>>> image = skimage.io.imread('PIA17145.tif')
|
||||
>>> from glymur import Jp2k
|
||||
>>> jp2 = Jp2k('PIA17145.jp2', 'wb')
|
||||
>>> jp2[:] = image
|
||||
>>> jp2 = Jp2k('PIA17145.jp2', data=image)
|
||||
|
||||
Next you can extract the XMP metadata.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,3 @@
|
|||
-------------------------------------
|
||||
Platforms Tested (0.7.0 release only)
|
||||
-------------------------------------
|
||||
* Linux Mint 17 / Python 3.4.0 and 2.7.6 / OpenJPEG 2.1.0 and 1.3.0
|
||||
* MacOS 10.6.8 / MacPorts Python 3.4.1, 3.3.5,and 2.7.8 / OpenJPEG 2.1.0
|
||||
* CentOS 6.5 / Anaconda Python 3.4.1 / OpenJPEG 1.3.0
|
||||
* Fedora 20 i386 / Python 2.7.5 and 3.3.2 / OpenJPEG 1.5.1
|
||||
* Windows 7 32bit / Anaconda Python 2.7.6 and 3.4.1 / OpenJPEG 2.1.0
|
||||
|
||||
------------
|
||||
Known Issues
|
||||
------------
|
||||
|
|
|
|||
|
|
@ -2,10 +2,26 @@
|
|||
Changes in glymur 0.7
|
||||
=====================
|
||||
|
||||
Changes in 0.7.3
|
||||
=================
|
||||
|
||||
* added read support back for metadata only when the OpenJPEG library is
|
||||
not installed
|
||||
|
||||
Changes in 0.7.2
|
||||
=================
|
||||
|
||||
* added ellipsis support in array-style slicing
|
||||
|
||||
Changes in 0.7.1
|
||||
=================
|
||||
|
||||
* fixed release notes regarding Python 3.4
|
||||
|
||||
Changes in 0.7.0
|
||||
=================
|
||||
|
||||
* implemented :py:meth:`__getitem__`, :py:meth:`__setitem__` support
|
||||
* added back windows support
|
||||
* box_id and longname are class attributes now instead of instance
|
||||
attributes (see issue 248)
|
||||
attributes
|
||||
|
|
|
|||
10
docs/source/whatsnew/0.8.rst
Normal file
10
docs/source/whatsnew/0.8.rst
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
=====================
|
||||
Changes in glymur 0.8
|
||||
=====================
|
||||
|
||||
Changes in 0.8.0
|
||||
=================
|
||||
|
||||
* Simplified writing images by moving data and options into the
|
||||
constructor. This is backwards-incompatible with 0.7.x.
|
||||
* Deprecated :py:meth:`read` method in favor of array-style slicing.
|
||||
|
|
@ -8,6 +8,7 @@ These document the changes between minor (or major) versions of glymur.
|
|||
|
||||
.. toctree::
|
||||
|
||||
0.5
|
||||
0.6
|
||||
0.8
|
||||
0.7
|
||||
0.6
|
||||
0.5
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue