pilkit


Namepilkit JSON
Version 3.0 PyPI version JSON
download
home_pagehttp://github.com/matthewwithanm/pilkit/
SummaryA collection of utilities and processors for the Python Imaging Library.
upload_time2023-09-27 22:47:18
maintainer
docs_urlNone
authorMatthew Tretter
requires_python
licenseBSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            PILKit is a collection of utilities for working with PIL (the Python Imaging
Library).

One of its main features is a set of **processors** which expose a simple
interface for performing manipulations on PIL images.

Looking for more advanced processors? Check out `Instakit`_!

**For the complete documentation on the latest stable version of PILKit, see**
`PILKit on RTD`_.

.. image:: https://github.com/matthewwithanm/pilkit/workflows/Python%20CI/badge.svg
  :target: https://github.com/matthewwithanm/pilkit/actions?query=workflow%3A%22Python+CI%22

.. _`PILKit on RTD`: http://pilkit.readthedocs.org
.. _`Instakit`: https://github.com/fish2000/instakit


Installation
============

1. Install `PIL`_ or `Pillow`_.
2. Run ``pip install pilkit`` (or clone the source and put the pilkit module on
   your path)

.. note:: If you've never seen Pillow before, it considers itself a
   more-frequently updated "friendly" fork of PIL that's compatible with
   setuptools. As such, it shares the same namespace as PIL does and is a
   drop-in replacement.

.. _`PIL`: http://pypi.python.org/pypi/PIL
.. _`Pillow`: http://pypi.python.org/pypi/Pillow


Usage Overview
==============


Processors
----------

The "pilkit.processors" module contains several classes for processing PIL
images, which provide an easy to understand API:

.. code-block:: python

    from pilkit.processors import ResizeToFit

    img = Image.open('/path/to/my/image.png')
    processor = ResizeToFit(100, 100)
    new_img = processor.process(img)

A few of the included processors are:

* ``ResizeToFit``
* ``ResizeToFill``
* ``SmartResize``
* ``Adjust``
* ``TrimBorderColor``
* ``Transpose``

There's also a ``ProcessorPipeline`` class for executing processors
sequentially:

.. code-block:: python

    from pilkit.processors import ProcessorPipeline, ResizeToFit, Adjust

    img = Image.open('/path/to/my/image.png')
    processor = ProcessorPipeline([Adjust(color=0), ResizeToFit(100, 100)])
    new_image = processor.process(img)


Utilities
---------

In addition to the processors, PILKit contains a few utilities to ease the pain
of working with PIL. Some examples:

``prepare_image``
    Prepares the image for saving to the provided format by doing some
    common-sense conversions, including preserving transparency and quantizing.
``save_image``
    Wraps PIL's ``Image.save()`` method in order to gracefully handle PIL's
    "Suspension not allowed here" errors, and (optionally) prepares the image
    using ``prepare_image``

Utilities are also included for converting between formats, extensions, and
mimetypes.


Community
=========

Please use `the GitHub issue tracker <https://github.com/matthewwithanm/pilkit/issues>`_
to report bugs. `A mailing list <https://groups.google.com/forum/#!forum/django-imagekit>`_
also exists to discuss the project and ask questions, as well as the official
`#imagekit <irc://irc.freenode.net/imagekit>`_ channel on Freenode. (Both of
these are shared with the `django-imagekit`_ project—from which PILKit spun
off.)

.. _`django-imagekit`: https://github.com/jdriscoll/django-imagekit

            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/matthewwithanm/pilkit/",
    "name": "pilkit",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Matthew Tretter",
    "author_email": "m@tthewwithanm.com",
    "download_url": "https://files.pythonhosted.org/packages/b9/a5/bbe12d2c9dc06e29224c45a2cd7aa0ce923648588b6a15aadfee150bbd0c/pilkit-3.0.tar.gz",
    "platform": null,
    "description": "PILKit is a collection of utilities for working with PIL (the Python Imaging\nLibrary).\n\nOne of its main features is a set of **processors** which expose a simple\ninterface for performing manipulations on PIL images.\n\nLooking for more advanced processors? Check out `Instakit`_!\n\n**For the complete documentation on the latest stable version of PILKit, see**\n`PILKit on RTD`_.\n\n.. image:: https://github.com/matthewwithanm/pilkit/workflows/Python%20CI/badge.svg\n  :target: https://github.com/matthewwithanm/pilkit/actions?query=workflow%3A%22Python+CI%22\n\n.. _`PILKit on RTD`: http://pilkit.readthedocs.org\n.. _`Instakit`: https://github.com/fish2000/instakit\n\n\nInstallation\n============\n\n1. Install `PIL`_ or `Pillow`_.\n2. Run ``pip install pilkit`` (or clone the source and put the pilkit module on\n   your path)\n\n.. note:: If you've never seen Pillow before, it considers itself a\n   more-frequently updated \"friendly\" fork of PIL that's compatible with\n   setuptools. As such, it shares the same namespace as PIL does and is a\n   drop-in replacement.\n\n.. _`PIL`: http://pypi.python.org/pypi/PIL\n.. _`Pillow`: http://pypi.python.org/pypi/Pillow\n\n\nUsage Overview\n==============\n\n\nProcessors\n----------\n\nThe \"pilkit.processors\" module contains several classes for processing PIL\nimages, which provide an easy to understand API:\n\n.. code-block:: python\n\n    from pilkit.processors import ResizeToFit\n\n    img = Image.open('/path/to/my/image.png')\n    processor = ResizeToFit(100, 100)\n    new_img = processor.process(img)\n\nA few of the included processors are:\n\n* ``ResizeToFit``\n* ``ResizeToFill``\n* ``SmartResize``\n* ``Adjust``\n* ``TrimBorderColor``\n* ``Transpose``\n\nThere's also a ``ProcessorPipeline`` class for executing processors\nsequentially:\n\n.. code-block:: python\n\n    from pilkit.processors import ProcessorPipeline, ResizeToFit, Adjust\n\n    img = Image.open('/path/to/my/image.png')\n    processor = ProcessorPipeline([Adjust(color=0), ResizeToFit(100, 100)])\n    new_image = processor.process(img)\n\n\nUtilities\n---------\n\nIn addition to the processors, PILKit contains a few utilities to ease the pain\nof working with PIL. Some examples:\n\n``prepare_image``\n    Prepares the image for saving to the provided format by doing some\n    common-sense conversions, including preserving transparency and quantizing.\n``save_image``\n    Wraps PIL's ``Image.save()`` method in order to gracefully handle PIL's\n    \"Suspension not allowed here\" errors, and (optionally) prepares the image\n    using ``prepare_image``\n\nUtilities are also included for converting between formats, extensions, and\nmimetypes.\n\n\nCommunity\n=========\n\nPlease use `the GitHub issue tracker <https://github.com/matthewwithanm/pilkit/issues>`_\nto report bugs. `A mailing list <https://groups.google.com/forum/#!forum/django-imagekit>`_\nalso exists to discuss the project and ask questions, as well as the official\n`#imagekit <irc://irc.freenode.net/imagekit>`_ channel on Freenode. (Both of\nthese are shared with the `django-imagekit`_ project\u2014from which PILKit spun\noff.)\n\n.. _`django-imagekit`: https://github.com/jdriscoll/django-imagekit\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "A collection of utilities and processors for the Python Imaging Library.",
    "version": "3.0",
    "project_urls": {
        "Homepage": "http://github.com/matthewwithanm/pilkit/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "deec877b84b82cbcba6203e39d068cecfdbcfb61de69260cb851ea11be9b67f3",
                "md5": "18729245634f640716f536d7db7d39f5",
                "sha256": "fe1707b0411a1d0cbf9ad3986779fa5a346cec4582a188740924aa39f504d117"
            },
            "downloads": -1,
            "filename": "pilkit-3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "18729245634f640716f536d7db7d39f5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 20073,
            "upload_time": "2023-09-27T22:47:16",
            "upload_time_iso_8601": "2023-09-27T22:47:16.285469Z",
            "url": "https://files.pythonhosted.org/packages/de/ec/877b84b82cbcba6203e39d068cecfdbcfb61de69260cb851ea11be9b67f3/pilkit-3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b9a5bbe12d2c9dc06e29224c45a2cd7aa0ce923648588b6a15aadfee150bbd0c",
                "md5": "a0cf00e63220df3d51d4286e614088d0",
                "sha256": "f6719e8cc0482e5447f5cb94f18b949d8e604ea9673a9b019c74d41b779e4eab"
            },
            "downloads": -1,
            "filename": "pilkit-3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a0cf00e63220df3d51d4286e614088d0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 402342,
            "upload_time": "2023-09-27T22:47:18",
            "upload_time_iso_8601": "2023-09-27T22:47:18.638102Z",
            "url": "https://files.pythonhosted.org/packages/b9/a5/bbe12d2c9dc06e29224c45a2cd7aa0ce923648588b6a15aadfee150bbd0c/pilkit-3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-27 22:47:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "matthewwithanm",
    "github_project": "pilkit",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "tox": true,
    "lcname": "pilkit"
}
        
Elapsed time: 0.15221s