more doc updates
This commit is contained in:
parent
a2a6b62316
commit
83df953389
4 changed files with 33 additions and 17 deletions
|
|
@ -7,11 +7,11 @@ How do I...?
|
|||
================
|
||||
Jp2k implements slicing via the :py:meth:`__getitem__` method, meaning that
|
||||
multiple resolution imagery in a JPEG 2000 file can
|
||||
easily be accessed. For example here's how to retrieve a full resolution and
|
||||
first lower-resolution image ::
|
||||
easily be accessed via array-style slicing. For example here's how to
|
||||
retrieve a full resolution and first lower-resolution image ::
|
||||
|
||||
>>> import glymur
|
||||
>>> jp2file = glymur.data.nemo()
|
||||
>>> jp2file = glymur.data.nemo() # just a path to a JPEG2000 file
|
||||
>>> jp2 = glymur.Jp2k(jp2file)
|
||||
>>> fullres = jp2[:]
|
||||
>>> print(fullres.shape)
|
||||
|
|
@ -20,8 +20,21 @@ first lower-resolution image ::
|
|||
>>> print(thumbnail.shape)
|
||||
(728, 1296, 3)
|
||||
|
||||
The :py:meth:`read` method gives many more options for other JPEG 2000 features
|
||||
such as quality layers.
|
||||
The :py:meth:`read` method exposes many more options for other JPEG 2000
|
||||
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?
|
||||
=====================
|
||||
|
|
@ -328,10 +341,10 @@ is currently limited to XML and UUID boxes.
|
|||
... create an image with an alpha layer?
|
||||
========================================
|
||||
|
||||
OpenJPEG can create JP2 files with more than 3 components (requires
|
||||
the development version of OpenJPEG), but by default, any extra components are
|
||||
not described as such. In order to do so, we need to rewrap such
|
||||
an image in a set of boxes that includes a channel definition box.
|
||||
OpenJPEG can create JP2 files with more than 3 components (use version 2.1.0+
|
||||
for this), but by default, any extra components are not described
|
||||
as such. In order to do so, we need to rewrap such an image in a
|
||||
set of boxes that includes a channel definition box.
|
||||
|
||||
This example is based on SciPy example code found at
|
||||
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?
|
||||
========================
|
||||
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. ::
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue