pyopenjpeg
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:JPEG 2000 in Python
PyOpenJPEG
==========

Deprecation Notice
------------------
This code is no longer being actively developed. For a more fully functional
and active effort to create a Python interface to OpenJPEG, check out the 
[Glymur](https://github.com/quintusdias/glymur) project.

Overview
--------
PyOpenJPEG is a Python wrapper around the [OpenJPEG ](www.openjpeg.org) 
[JPEG 2000](http://www.jpeg.org/jpeg2000/) image library written using 
[Cython](http://www.cython.org/).

Installation
------------

**NOTE:** This library is currently in the early stages of development and is
not yet ready for use. 

First, install [OpenJPEG 2.0](http://www.openjpeg.org/index.php?menu=download)
using either the provided binaries, or by compiling from source. 

To install PyOpenJPEG, run:

    python setup.py build_ext -i
    python setup.py install

Usage
-----

Here is a quick example of decoding an image:

```python
>>> import openjpeg
>>> decoder = openjpeg.Decoder()
>>> img = decoder.decode(openjpeg.IMAGE_EIT)
```

Development
-----------
When contributing to PyOpenJPEG, it is recommended that you install the [latest
version of OpenJPEG from SVN](http://code.google.com/p/openjpeg/source/checkout).

Below are instructions for downloading and building the latest branch on Linux:

    svn checkout http://openjpeg.googlecode.com/svn/trunk/ openjpeg
    cd openjpeg
    cmake build
    make
    sudo make install
 
There is currently [an issue with OpenJPEG install](https://groups.google.com/forum/?fromgroups#!topic/openjpeg/YllZliu6Vo4)
which prevents some necessary includes being placed in the proper location. 
On Linux, you can you fix this by doing: ::

    sudo su -
    for file in /usr/local/include/openjpeg-1.99/*.h; do ln -s ${file} /usr/local/include/; done

The above command will create symbolic links in /usr/local/include to several 
needed header files.

To compile the PyOpenJPEG Cython code, run:

    python setup.py build_ext -i

TODO
----
1. Add support for saving to some common formats (BMP, PNG, etc)
2. Add encoding support
3. Automatically detect bit-depth of images during decoding

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。