netpbmfile


Namenetpbmfile JSON
Version 2020.10.18 PyPI version JSON
download
home_pagehttps://www.lfd.uci.edu/~gohlke/
SummaryRead and write Netpbm files
upload_time2020-10-18 06:13:28
maintainer
docs_urlNone
authorChristoph Gohlke
requires_python>=3.6
licenseBSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Read and write Netpbm files
===========================

Netpbmfile is a Python library to read and write image files in the Netpbm
format as specified at http://netpbm.sourceforge.net/doc/.

The following Netpbm and Portable FloatMap formats are supported:

* PBM (bi-level)
* PGM (grayscale)
* PPM (color)
* PAM (arbitrary)
* XV thumbnail (RGB332, read-only)
* PF (float32 RGB, read-only)
* Pf (float32 grayscale, read-only)

No gamma correction is performed. Only one image per file is supported.

:Author:
  `Christoph Gohlke <https://www.lfd.uci.edu/~gohlke/>`_

:Organization:
  Laboratory for Fluorescence Dynamics, University of California, Irvine

:License: BSD 3-Clause

:Version: 2020.10.18

Requirements
------------
* `CPython >= 3.7 <https://www.python.org>`_
* `Numpy 1.15 <https://www.numpy.org>`_
* `Matplotlib 3.2 <https://www.matplotlib.org>`_ (optional for plotting)

Revisions
---------
2020.10.18
    Disallow comments after last value in PNM headers.
2020.9.18
    Remove support for Python 3.6 (NEP 29).
    Support os.PathLike file names.
2020.1.1
    Fix reading tightly packed P1 format and ASCII data with inline comments.
    Remove support for Python 2.7 and 3.5.
    Update copyright.
2018.10.18
    Move netpbmfile.py into netpbmfile package.
2018.02.18
    Support Portable FloatMaps.
    Style fixes.
2016.02.24
    Use 'fromdata' classmethod to initialize from data.
    Support 'with' statement.
    Scale RGB images to maxval for display.
    Make keyword arguments explicit.
    Support numpy 1.10.

Examples
--------
Save a numpy array to a Netpbm file in grayscale format:

>>> data = numpy.array([[0, 1], [65534, 65535]], dtype='uint16')
>>> imwrite('_tmp.pgm', data)

Read the image data from a Netpbm file as numpy array:

>>> image = imread('_tmp.pgm')
>>> assert numpy.all(image == data)

Access meta and image data in a Netpbm file:

>>> with NetpbmFile('_tmp.pgm') as pgm:
...     pgm.axes
...     pgm.shape
...     pgm.dtype
...     pgm.maxval
...     pgm.magicnum
...     image = pgm.asarray()
'YX'
(2, 2)
dtype('>u2')
65535
b'P5'



            

Raw data

            {
    "_id": null,
    "home_page": "https://www.lfd.uci.edu/~gohlke/",
    "name": "netpbmfile",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Christoph Gohlke",
    "author_email": "cgohlke@uci.edu",
    "download_url": "https://files.pythonhosted.org/packages/6e/e1/ce8febda00d63b01acd3f6f8b3cd498256c29ff3402aae27c84326ee6ceb/netpbmfile-2020.10.18.tar.gz",
    "platform": "any",
    "description": "Read and write Netpbm files\n===========================\n\nNetpbmfile is a Python library to read and write image files in the Netpbm\nformat as specified at http://netpbm.sourceforge.net/doc/.\n\nThe following Netpbm and Portable FloatMap formats are supported:\n\n* PBM (bi-level)\n* PGM (grayscale)\n* PPM (color)\n* PAM (arbitrary)\n* XV thumbnail (RGB332, read-only)\n* PF (float32 RGB, read-only)\n* Pf (float32 grayscale, read-only)\n\nNo gamma correction is performed. Only one image per file is supported.\n\n:Author:\n  `Christoph Gohlke <https://www.lfd.uci.edu/~gohlke/>`_\n\n:Organization:\n  Laboratory for Fluorescence Dynamics, University of California, Irvine\n\n:License: BSD 3-Clause\n\n:Version: 2020.10.18\n\nRequirements\n------------\n* `CPython >= 3.7 <https://www.python.org>`_\n* `Numpy 1.15 <https://www.numpy.org>`_\n* `Matplotlib 3.2 <https://www.matplotlib.org>`_ (optional for plotting)\n\nRevisions\n---------\n2020.10.18\n    Disallow comments after last value in PNM headers.\n2020.9.18\n    Remove support for Python 3.6 (NEP 29).\n    Support os.PathLike file names.\n2020.1.1\n    Fix reading tightly packed P1 format and ASCII data with inline comments.\n    Remove support for Python 2.7 and 3.5.\n    Update copyright.\n2018.10.18\n    Move netpbmfile.py into netpbmfile package.\n2018.02.18\n    Support Portable FloatMaps.\n    Style fixes.\n2016.02.24\n    Use 'fromdata' classmethod to initialize from data.\n    Support 'with' statement.\n    Scale RGB images to maxval for display.\n    Make keyword arguments explicit.\n    Support numpy 1.10.\n\nExamples\n--------\nSave a numpy array to a Netpbm file in grayscale format:\n\n>>> data = numpy.array([[0, 1], [65534, 65535]], dtype='uint16')\n>>> imwrite('_tmp.pgm', data)\n\nRead the image data from a Netpbm file as numpy array:\n\n>>> image = imread('_tmp.pgm')\n>>> assert numpy.all(image == data)\n\nAccess meta and image data in a Netpbm file:\n\n>>> with NetpbmFile('_tmp.pgm') as pgm:\n...     pgm.axes\n...     pgm.shape\n...     pgm.dtype\n...     pgm.maxval\n...     pgm.magicnum\n...     image = pgm.asarray()\n'YX'\n(2, 2)\ndtype('>u2')\n65535\nb'P5'\n\n\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Read and write Netpbm files",
    "version": "2020.10.18",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "4588f4013f3363c68345b136f6b27a3c",
                "sha256": "4b3024c77f00418479c010e89008dd4fde6ab3500c1f1247e8e8341991ed7e0e"
            },
            "downloads": -1,
            "filename": "netpbmfile-2020.10.18-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4588f4013f3363c68345b136f6b27a3c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 9578,
            "upload_time": "2020-10-18T06:13:27",
            "upload_time_iso_8601": "2020-10-18T06:13:27.434795Z",
            "url": "https://files.pythonhosted.org/packages/79/4c/e9dad49b6c62841099e8f0c843bfa82dc9d61f5fc0fff6f728773674db39/netpbmfile-2020.10.18-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "a4100d48cc68a0569a5a1215fbb4ea5d",
                "sha256": "0b6a081e0df62f1f576f9881653a4a00d7eb14f13eb4f260495cbf963a7c990d"
            },
            "downloads": -1,
            "filename": "netpbmfile-2020.10.18.tar.gz",
            "has_sig": false,
            "md5_digest": "a4100d48cc68a0569a5a1215fbb4ea5d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 8456,
            "upload_time": "2020-10-18T06:13:28",
            "upload_time_iso_8601": "2020-10-18T06:13:28.508529Z",
            "url": "https://files.pythonhosted.org/packages/6e/e1/ce8febda00d63b01acd3f6f8b3cd498256c29ff3402aae27c84326ee6ceb/netpbmfile-2020.10.18.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-10-18 06:13:28",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "netpbmfile"
}
        
Elapsed time: 0.17938s