pixelize


Namepixelize JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/Dashstrom/pixelize
SummaryTurn images into pixel arts.
upload_time2024-05-08 22:42:43
maintainerDashstrom
docs_urlNone
authorDashstrom
requires_python<3.12,>=3.8
licenseMIT
keywords python cli script pixel-art image-to-image
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. role:: bash(code)
  :language: bash

********
pixelize
********

|ci-docs| |ci-lint| |ci-tests| |pypi| |versions| |discord| |license|

.. |ci-docs| image:: https://github.com/Dashstrom/pixelize/actions/workflows/docs.yml/badge.svg
  :target: https://github.com/Dashstrom/pixelize/actions/workflows/docs.yml
  :alt: CI : Docs
.. |ci-lint| image:: https://github.com/Dashstrom/pixelize/actions/workflows/lint.yml/badge.svg
  :target: https://github.com/Dashstrom/pixelize/actions/workflows/lint.yml
  :alt: CI : Lint
.. |ci-tests| image:: https://github.com/Dashstrom/pixelize/actions/workflows/tests.yml/badge.svg
  :target: https://github.com/Dashstrom/pixelize/actions/workflows/tests.yml
  :alt: CI : Tests
.. |pypi| image:: https://img.shields.io/pypi/v/pixelize.svg
  :target: https://pypi.org/project/pixelize
  :alt: PyPI : pixelize
.. |versions| image:: https://img.shields.io/pypi/pyversions/pixelize.svg
  :target: https://pypi.org/project/pixelize
  :alt: Python : versions
.. |discord| image:: https://img.shields.io/badge/Discord-Dashstrom-5865F2?style=flat&logo=discord&logoColor=white
  :target: https://dsc.gg/dashstrom
  :alt: Discord
.. |license| image:: https://img.shields.io/badge/license-MIT-green.svg
  :target: https://github.com/Dashstrom/pixelize/blob/main/LICENSE
  :alt: License : MIT

Description
###########

Turn images into pixel arts.

Documentation
#############

Documentation is available on https://dashstrom.github.io/pixelize

Installation
############

You can install :bash:`pixelize` using `pip <https://pypi.org/project/pip/>`_
from `PyPI <https://pypi.org/project>`_

..  code-block:: bash

  pip install pipx
  pipx ensurepath
  pipx install pixelize

You can also install gpu support for rembg dependency using:

..  code-block:: bash

  pipx inject pixelize rembg[gpu]

Usage
#####

..  code-block:: bash

  pixelize --version
  pixelize --help

Example: Cropping
*****************

..  code-block:: bash

  pixelize \
    -i ./docs/examples/car.jpg \
    --height 128 \
    --crop 0x80+136x216 \
    --color-reduction 4 \
    --output-dir ./docs/examples/pixelized

.. image:: https://raw.githubusercontent.com/Dashstrom/pixelize/main/docs/examples/car.jpg
   :width: 128

.. image:: https://raw.githubusercontent.com/Dashstrom/pixelize/main/docs/examples/pixelized/car.pix.png
   :width: 128

Example: Border
***************

..  code-block:: bash

  pixelize \
    -i ./docs/examples/cat.bmp \
    --height 32 \
    --border \
    --output-dir ./docs/examples/pixelized

.. image:: https://raw.githubusercontent.com/Dashstrom/pixelize/main/docs/examples/cat.bmp
   :width: 128

.. image:: https://raw.githubusercontent.com/Dashstrom/pixelize/main/docs/examples/pixelized/cat.pix.png
   :width: 128

Example: Rembg
**************

..  code-block:: bash

  pixelize \
    -i swing.jpg \
    --height 128 \
    --rembg \
    --border \
    --color-reduction 5

.. image:: https://raw.githubusercontent.com/Dashstrom/pixelize/main/docs/examples/swing.jpg
   :width: 128

.. image:: https://raw.githubusercontent.com/Dashstrom/pixelize/main/docs/examples/pixelized/swing.pix.png
   :width: 128

Example: Module
***************

..  code-block:: python

  from pixelize import pixelize
  from pathlib import Path
  from PIL import Image

  image_path = "image.png"

  # Using str
  im = pixelize(image_path)

  # Using pathlib.Path
  im = pixelize(Path(image_path))

  # Using stream
  with open("image.png", "rb") as file:
    im = pixelize(file)

  # Using Pillow
  im = pixelize(Image.open("image.png"))

Development
###########

Contributing
************

Contributions are very welcome. Tests can be run with :bash:`poe check`, please
ensure the coverage at least stays the same before you submit a pull request.

Setup
*****

You need to install `Poetry <https://python-poetry.org/docs/#installation>`_
and `Git <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`_
for work with this project.

..  code-block:: bash

  git clone https://github.com/Dashstrom/pixelize
  cd pixelize
  poetry install --all-extras
  poetry run poe setup
  poetry shell

Poe
***

Poe is available for help you to run tasks.

..  code-block:: text

  test           Run test suite.
  lint           Run linters : ruff linter, ruff formatter and mypy.
  format         Run linters in fix mode.
  check          Run all checks : lint, test and docs.
  cov            Run coverage for generate report and html.
  open-cov       Open html coverage report in webbrowser.
  docs           Build documentation.
  open-docs      Open documentation in webbrowser.
  setup          Setup pre-commit.
  pre-commit     Run pre-commit.
  clean          Clean cache files

Skip commit verification
************************

If the linting is not successful, you can't commit.
For forcing the commit you can use the next command :

..  code-block:: bash

  git commit --no-verify -m 'MESSAGE'

Commit with commitizen
**********************

To respect commit conventions, this repository uses
`Commitizen <https://github.com/commitizen-tools/commitizen?tab=readme-ov-file>`_.

..  code-block:: bash

  cz commit

How to add dependency
*********************

..  code-block:: bash

  poetry add 'PACKAGE'

Ignore illegitimate warnings
****************************

To ignore illegitimate warnings you can add :

- **# noqa: ERROR_CODE** on the same line for ruff.
- **# type: ignore[ERROR_CODE]** on the same line for mypy.
- **# pragma: no cover** on the same line to ignore line for coverage.
- **# doctest: +SKIP** on the same line for doctest.

Uninstall
#########

..  code-block:: bash

  pip uninstall pixelize

License
#######

This work is licensed under `MIT <https://github.com/Dashstrom/pixelize/-/raw/main/LICENSE>`_.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Dashstrom/pixelize",
    "name": "pixelize",
    "maintainer": "Dashstrom",
    "docs_url": null,
    "requires_python": "<3.12,>=3.8",
    "maintainer_email": "dashstrom.pro@gmail.com",
    "keywords": "python, cli, script, pixel-art, image-to-image",
    "author": "Dashstrom",
    "author_email": "dashstrom.pro@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b3/3a/78aa9c9c05ac986babf52fd5cf72a6331f04fba957c5174a6f991d91a131/pixelize-0.0.2.tar.gz",
    "platform": null,
    "description": ".. role:: bash(code)\n  :language: bash\n\n********\npixelize\n********\n\n|ci-docs| |ci-lint| |ci-tests| |pypi| |versions| |discord| |license|\n\n.. |ci-docs| image:: https://github.com/Dashstrom/pixelize/actions/workflows/docs.yml/badge.svg\n  :target: https://github.com/Dashstrom/pixelize/actions/workflows/docs.yml\n  :alt: CI : Docs\n.. |ci-lint| image:: https://github.com/Dashstrom/pixelize/actions/workflows/lint.yml/badge.svg\n  :target: https://github.com/Dashstrom/pixelize/actions/workflows/lint.yml\n  :alt: CI : Lint\n.. |ci-tests| image:: https://github.com/Dashstrom/pixelize/actions/workflows/tests.yml/badge.svg\n  :target: https://github.com/Dashstrom/pixelize/actions/workflows/tests.yml\n  :alt: CI : Tests\n.. |pypi| image:: https://img.shields.io/pypi/v/pixelize.svg\n  :target: https://pypi.org/project/pixelize\n  :alt: PyPI : pixelize\n.. |versions| image:: https://img.shields.io/pypi/pyversions/pixelize.svg\n  :target: https://pypi.org/project/pixelize\n  :alt: Python : versions\n.. |discord| image:: https://img.shields.io/badge/Discord-Dashstrom-5865F2?style=flat&logo=discord&logoColor=white\n  :target: https://dsc.gg/dashstrom\n  :alt: Discord\n.. |license| image:: https://img.shields.io/badge/license-MIT-green.svg\n  :target: https://github.com/Dashstrom/pixelize/blob/main/LICENSE\n  :alt: License : MIT\n\nDescription\n###########\n\nTurn images into pixel arts.\n\nDocumentation\n#############\n\nDocumentation is available on https://dashstrom.github.io/pixelize\n\nInstallation\n############\n\nYou can install :bash:`pixelize` using `pip <https://pypi.org/project/pip/>`_\nfrom `PyPI <https://pypi.org/project>`_\n\n..  code-block:: bash\n\n  pip install pipx\n  pipx ensurepath\n  pipx install pixelize\n\nYou can also install gpu support for rembg dependency using:\n\n..  code-block:: bash\n\n  pipx inject pixelize rembg[gpu]\n\nUsage\n#####\n\n..  code-block:: bash\n\n  pixelize --version\n  pixelize --help\n\nExample: Cropping\n*****************\n\n..  code-block:: bash\n\n  pixelize \\\n    -i ./docs/examples/car.jpg \\\n    --height 128 \\\n    --crop 0x80+136x216 \\\n    --color-reduction 4 \\\n    --output-dir ./docs/examples/pixelized\n\n.. image:: https://raw.githubusercontent.com/Dashstrom/pixelize/main/docs/examples/car.jpg\n   :width: 128\n\n.. image:: https://raw.githubusercontent.com/Dashstrom/pixelize/main/docs/examples/pixelized/car.pix.png\n   :width: 128\n\nExample: Border\n***************\n\n..  code-block:: bash\n\n  pixelize \\\n    -i ./docs/examples/cat.bmp \\\n    --height 32 \\\n    --border \\\n    --output-dir ./docs/examples/pixelized\n\n.. image:: https://raw.githubusercontent.com/Dashstrom/pixelize/main/docs/examples/cat.bmp\n   :width: 128\n\n.. image:: https://raw.githubusercontent.com/Dashstrom/pixelize/main/docs/examples/pixelized/cat.pix.png\n   :width: 128\n\nExample: Rembg\n**************\n\n..  code-block:: bash\n\n  pixelize \\\n    -i swing.jpg \\\n    --height 128 \\\n    --rembg \\\n    --border \\\n    --color-reduction 5\n\n.. image:: https://raw.githubusercontent.com/Dashstrom/pixelize/main/docs/examples/swing.jpg\n   :width: 128\n\n.. image:: https://raw.githubusercontent.com/Dashstrom/pixelize/main/docs/examples/pixelized/swing.pix.png\n   :width: 128\n\nExample: Module\n***************\n\n..  code-block:: python\n\n  from pixelize import pixelize\n  from pathlib import Path\n  from PIL import Image\n\n  image_path = \"image.png\"\n\n  # Using str\n  im = pixelize(image_path)\n\n  # Using pathlib.Path\n  im = pixelize(Path(image_path))\n\n  # Using stream\n  with open(\"image.png\", \"rb\") as file:\n    im = pixelize(file)\n\n  # Using Pillow\n  im = pixelize(Image.open(\"image.png\"))\n\nDevelopment\n###########\n\nContributing\n************\n\nContributions are very welcome. Tests can be run with :bash:`poe check`, please\nensure the coverage at least stays the same before you submit a pull request.\n\nSetup\n*****\n\nYou need to install `Poetry <https://python-poetry.org/docs/#installation>`_\nand `Git <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`_\nfor work with this project.\n\n..  code-block:: bash\n\n  git clone https://github.com/Dashstrom/pixelize\n  cd pixelize\n  poetry install --all-extras\n  poetry run poe setup\n  poetry shell\n\nPoe\n***\n\nPoe is available for help you to run tasks.\n\n..  code-block:: text\n\n  test           Run test suite.\n  lint           Run linters : ruff linter, ruff formatter and mypy.\n  format         Run linters in fix mode.\n  check          Run all checks : lint, test and docs.\n  cov            Run coverage for generate report and html.\n  open-cov       Open html coverage report in webbrowser.\n  docs           Build documentation.\n  open-docs      Open documentation in webbrowser.\n  setup          Setup pre-commit.\n  pre-commit     Run pre-commit.\n  clean          Clean cache files\n\nSkip commit verification\n************************\n\nIf the linting is not successful, you can't commit.\nFor forcing the commit you can use the next command :\n\n..  code-block:: bash\n\n  git commit --no-verify -m 'MESSAGE'\n\nCommit with commitizen\n**********************\n\nTo respect commit conventions, this repository uses\n`Commitizen <https://github.com/commitizen-tools/commitizen?tab=readme-ov-file>`_.\n\n..  code-block:: bash\n\n  cz commit\n\nHow to add dependency\n*********************\n\n..  code-block:: bash\n\n  poetry add 'PACKAGE'\n\nIgnore illegitimate warnings\n****************************\n\nTo ignore illegitimate warnings you can add :\n\n- **# noqa: ERROR_CODE** on the same line for ruff.\n- **# type: ignore[ERROR_CODE]** on the same line for mypy.\n- **# pragma: no cover** on the same line to ignore line for coverage.\n- **# doctest: +SKIP** on the same line for doctest.\n\nUninstall\n#########\n\n..  code-block:: bash\n\n  pip uninstall pixelize\n\nLicense\n#######\n\nThis work is licensed under `MIT <https://github.com/Dashstrom/pixelize/-/raw/main/LICENSE>`_.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Turn images into pixel arts.",
    "version": "0.0.2",
    "project_urls": {
        "Documentation": "https://dashstrom.github.io/pixelize",
        "Homepage": "https://github.com/Dashstrom/pixelize",
        "Repository": "https://github.com/Dashstrom/pixelize"
    },
    "split_keywords": [
        "python",
        " cli",
        " script",
        " pixel-art",
        " image-to-image"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "47a46f562bd2e2e6daf9948058534a599fed06e15db0364e8921949a895cd6fe",
                "md5": "720e04a50d3564a1ff8f68cac7a21073",
                "sha256": "0d20538ef3b21788d1f5b5bcb9b14101e3233c0830871bd83084e127091d4ae4"
            },
            "downloads": -1,
            "filename": "pixelize-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "720e04a50d3564a1ff8f68cac7a21073",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.8",
            "size": 9390,
            "upload_time": "2024-05-08T22:42:42",
            "upload_time_iso_8601": "2024-05-08T22:42:42.741191Z",
            "url": "https://files.pythonhosted.org/packages/47/a4/6f562bd2e2e6daf9948058534a599fed06e15db0364e8921949a895cd6fe/pixelize-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b33a78aa9c9c05ac986babf52fd5cf72a6331f04fba957c5174a6f991d91a131",
                "md5": "174550dc56c4bf1d1721af57052525c5",
                "sha256": "520e33bb8d972b8d511a83b96a56774c7475f39ac34f56345eaf1aaa791aa3e9"
            },
            "downloads": -1,
            "filename": "pixelize-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "174550dc56c4bf1d1721af57052525c5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12,>=3.8",
            "size": 11749,
            "upload_time": "2024-05-08T22:42:43",
            "upload_time_iso_8601": "2024-05-08T22:42:43.886615Z",
            "url": "https://files.pythonhosted.org/packages/b3/3a/78aa9c9c05ac986babf52fd5cf72a6331f04fba957c5174a6f991d91a131/pixelize-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-08 22:42:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Dashstrom",
    "github_project": "pixelize",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pixelize"
}
        
Elapsed time: 0.70200s