more doc updates

This commit is contained in:
jevans 2014-09-25 18:57:13 -04:00
commit fc2519ca75
4 changed files with 33 additions and 17 deletions

View file

@ -24,11 +24,11 @@ configuration format is the same as used by Python’s configparser
module, i.e. :: module, i.e. ::
[library] [library]
openjp2: /opt/openjp2-svn/lib/libopenjp2.so openjp2: /somewhere/lib/libopenjp2.so
This assumes, of course, that you've installed OpenJPEG into This assumes, of course, that you've installed OpenJPEG into
/opt/openjp2-svn on a linux system. The location of the configuration file /opt/openjpeg on a linux system. The location of the configuration file
can vary as well (of course). If you use either linux or mac, the path can vary as well. If you use either linux or mac, the path
to the configuration file would normally be :: to the configuration file would normally be ::
$HOME/.config/glymur/glymurrc $HOME/.config/glymur/glymurrc
@ -48,7 +48,7 @@ You may also include a line for the version 1.x openjpeg library if you have it
installed in a non-standard place, i.e. :: installed in a non-standard place, i.e. ::
[library] [library]
openjpeg: /not/the/usual/location/lib/libopenjpeg.so openjpeg: /somewhere/lib/libopenjpeg.so
''''''' '''''''
Testing Testing

View file

@ -7,11 +7,11 @@ How do I...?
================ ================
Jp2k implements slicing via the :py:meth:`__getitem__` method, meaning that Jp2k implements slicing via the :py:meth:`__getitem__` method, meaning that
multiple resolution imagery in a JPEG 2000 file can multiple resolution imagery in a JPEG 2000 file can
easily be accessed. For example here's how to retrieve a full resolution and easily be accessed via array-style slicing. For example here's how to
first lower-resolution image :: retrieve a full resolution and first lower-resolution image ::
>>> import glymur >>> import glymur
>>> jp2file = glymur.data.nemo() >>> jp2file = glymur.data.nemo() # just a path to a JPEG2000 file
>>> jp2 = glymur.Jp2k(jp2file) >>> jp2 = glymur.Jp2k(jp2file)
>>> fullres = jp2[:] >>> fullres = jp2[:]
>>> print(fullres.shape) >>> print(fullres.shape)
@ -20,8 +20,21 @@ first lower-resolution image ::
>>> print(thumbnail.shape) >>> print(thumbnail.shape)
(728, 1296, 3) (728, 1296, 3)
The :py:meth:`read` method gives many more options for other JPEG 2000 features The :py:meth:`read` method exposes many more options for other JPEG 2000
such as quality layers. 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.
>>> import glymur, numpy as np
>>> jp2 = glymur.Jp2k('zeros.jp2', mode='wb')
>>> jp2[:] = np.zeros((640, 480), dtype=np.uint8)
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.
... display metadata? ... display metadata?
===================== =====================
@ -328,10 +341,10 @@ is currently limited to XML and UUID boxes.
... create an image with an alpha layer? ... create an image with an alpha layer?
======================================== ========================================
OpenJPEG can create JP2 files with more than 3 components (requires OpenJPEG can create JP2 files with more than 3 components (use version 2.1.0+
the development version of OpenJPEG), but by default, any extra components are for this), but by default, any extra components are not described
not described as such. In order to do so, we need to rewrap such as such. In order to do so, we need to rewrap such an image in a
an image in a set of boxes that includes a channel definition box. set of boxes that includes a channel definition box.
This example is based on SciPy example code found at This example is based on SciPy example code found at
http://scipy-lectures.github.io/advanced/image_processing/#basic-manipulations . http://scipy-lectures.github.io/advanced/image_processing/#basic-manipulations .
@ -389,7 +402,11 @@ Here's how the Preview application on the mac shows the RGBA image.
... work with XMP UUIDs? ... work with XMP UUIDs?
======================== ========================
XMP is metadata on steroids. `Wikipedia <http://en.wikipedia.org/wiki/Extensible_Metadata_Platform>`_ states
that "The Extensible Metadata Platform (XMP) is an ISO standard,
originally created by Adobe Systems Inc., for the creation, processing
and interchange of standardized and custom metadata for all kinds
of resources."
The example JP2 file shipped with glymur has an XMP UUID. :: The example JP2 file shipped with glymur has an XMP UUID. ::

View file

@ -10,12 +10,11 @@ JPEG 2000 images is currently limited to images that can fit in memory.
but it is strongly recommended to use version 2.1.0, which is the most recently but it is strongly recommended to use version 2.1.0, which is the most recently
released version of OpenJPEG at this time. released version of OpenJPEG at this time.
In regards to metadata, most JP2 boxes are properly interpreted. In regards to metadata, most JP2 boxes are properly interpreted.
Certain optional JP2 boxes can also be written, including XML boxes and Certain optional JP2 boxes can also be written, including XML boxes and
XMP UUIDs. There is incomplete support for reading JPX metadata. XMP UUIDs. There is incomplete support for reading JPX metadata.
Glymur 0.6 works on Python versions 2.7, 3.3 and 3.4. If you have Python 2.6, Glymur works on Python versions 2.7, 3.3 and 3.4. If you have Python 2.6,
you should use the 0.5 series of Glymur. you should use the 0.5 series of Glymur.
For more information about OpenJPEG, please consult http://www.openjpeg.org. For more information about OpenJPEG, please consult http://www.openjpeg.org.

View file

@ -2,7 +2,7 @@
Platforms Tested (0.7.0 release only) 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 * 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 * MacOS 10.6.8 / MacPorts / Python 3.4.1, 3.3.5,and 2.7.8
* CentOS 6.5 / Anaconda Python 3.4.1 / OpenJPEG 1.3.0 * CentOS 6.5 / Anaconda Python 3.4.1 / OpenJPEG 1.3.0
------------ ------------