{ "info": { "author": "Bernard Zhao", "author_email": "bernardzhao@berkeley.edu", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# pixelsort\n\n### What is Pixel Sorting?\n\nHave a look at [this post](http://satyarth.me/articles/pixel-sorting/) or [/r/pixelsorting](http://www.reddit.com/r/pixelsorting/top/)\n\n### Dependencies\n\nPython 3.6 or greater.\n\nRequires Pillow. `pip install Pillow` should work. If not, see [here](https://pillow.readthedocs.org/en/3.0.0/installation.html#linux-installation) for details.\n\nThere is also a requirements file which pretty much does the same via `pip install -r requirements.txt`.\n\n### Usage\n\nFrom the command line:\n\n```\ngit clone https://github.com/satyarth/pixelsort.git\ncd pixelsort\npython3 pixelsort.py %PathToImage% [options]\n```\n\nTip: To replicate Kim Asendorf's original [processing script](https://github.com/kimasendorf/ASDFPixelSort), first sort vertically and then horizontally in `threshold` (default) mode:\n\n```\npython3 pixelsort.py %PathToImage% -a 90\npython3 pixelsort.py %PathToSortedImage%\n```\n\n#### Parameters:\n\nParameter \t\t\t| Flag \t| Description\n--------------------|-------|------------\nInterval function \t| `-i`\t| Controls how the intervals used for sorting are defined. See below for more details and examples.\nOutput file \t\t| `-o`\t| Path of output file. Randomly generates a file name by default.\nRandomness \t\t\t| `-r`\t| What percentage of intervals *not* to sort. 0 by default.\nThreshold (lower) \t| `-t`\t| How dark must a pixel be to be considered as a 'border' for sorting? Takes values from 0-1. 0.25 by default. Used in `edges` and `threshold` modes.\nThreshold (upper) \t| `-u`\t| How bright must a pixel be to be considered as a 'border' for sorting? Takes values from 0-1. 0.8 by default. Used in `threshold` mode.\nChar. length\t\t| `-c`\t| Characteristic length for the random width generator. Used in mode `random`.\nAngle \t\t\t\t| `-a`\t| Angle at which you're pixel sorting in degrees. `0` (horizontal) by default.\nExternal interval file \t| `-f` \t| Image used to define intervals. Must be black and white.\nSorting function | `-s` | Sorting function to use for sorting the pixels.\nMask | `-m` | Image used for masking parts of the image.\nLogging Level | `-l` | Level of logging statements made visible. Choices include `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL`.\n\n#### Interval Functions\n\nInterval function \t| Description\n--------------------|------------\n`random`\t\t\t| Randomly generate intervals. Distribution of widths is linear by default. Interval widths can be scaled using `clength`.\n`edges`\t\t\t\t| Performs an edge detection, which is used to define intervals. Tweak threshold with `threshold`.\n`threshold`\t\t\t| Intervals defined by lightness thresholds; only pixels with a lightness between the upper and lower thresholds are sorted.\n`waves`\t\t\t\t| Intervals are waves of nearly uniform widths. Control width of waves with `clength`.\n`file`\t\t\t\t| Intervals taken from another specified input image. Must be black and white, and the same size as the input image.\n`file-edges`\t\t| Intevals defined by performing edge detection on the file specified by `-f`. Must be the same size as the input image.\n`none`\t\t\t\t| Sort whole rows, only stopping at image borders.\n\n\n#### Sorting Functions\n\nSorting function | Description\n--------------------|------------\n`lightness` | Sort by the lightness of a pixel according to a HSV representation.\n`hue` | Sort by the hue of a pixel according to a HSV representation.\n`saturation` | Sort by the saturation of a pixel according to a HSV representation.\n`intensity` | Sort by the intensity of a pixel, i.e. the sum of all the RGB values.\n`minimum` | Sort on the minimum RGB value of a pixel (either the R, G or B).\n\n#### Examples\n\n`python3 pixelsort.py examples/image.jpg -i random -c 20`\n\n![random](/examples/random.png)\n\n`python3 pixelsort.py examples/image.jpg -i edges -t 250`\n\n![edges](/examples/edges.png)\n\n* `file`: Intervals taken from image specified with `-f`. Must be black and white.\n\n`python3 pixelsort.py examples/image.jpg -i file -f examples/intervals.png `\n\n![file](/examples/intervals.png)\n\n(generated with [elementary-ca](https://github.com/satyarth/elementary-ca))\n\n![file](/examples/file.png)\n\n* `mask`: Mask taken from image specified with `-m`. Must be black and white.\n\n`python3 pixelsort.py examples/image.jpg -i random -c 20 -m examples/mask.png`\n\n![file](/examples/mask.png)\n\n![file](/examples/masked.png)\n\n### todo\n\n* Allow defining different intervals for different channels.\n\n---\n\nBased on https://gist.github.com/LycaonIsAWolf/667c5554e5d9d9a25ae6\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/satyarth/pixelsort", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "pixelsort", "package_url": "https://pypi.org/project/pixelsort/", "platform": "", "project_url": "https://pypi.org/project/pixelsort/", "project_urls": { "Homepage": "https://github.com/satyarth/pixelsort" }, "release_url": "https://pypi.org/project/pixelsort/0.0.10/", "requires_dist": [ "Pillow (>=6.1.0)" ], "requires_python": ">=3.6", "summary": "An image pixelsorter for Python.", "version": "0.0.10" }, "last_serial": 5798331, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "222eea454045a44920085fbb86fac2ad", "sha256": "6bc1364656ac334ccd4fea693eb72e26f21acf56acc7746b46a73ecc3273ad00" }, "downloads": -1, "filename": "pixelsort-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "222eea454045a44920085fbb86fac2ad", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9523, "upload_time": "2019-09-08T04:46:51", "url": "https://files.pythonhosted.org/packages/63/c6/4d75cf3873427a35efe23b2a4f0bccb6498bd21a2642e99551aace460ae8/pixelsort-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e7839bc432e4215664226bd4a940fd7", "sha256": "1ed66c44270e1da9f1ec3c7ca2ebd9d95a32635f3c553cfd5d48a6ac2767ec28" }, "downloads": -1, "filename": "pixelsort-0.0.1.tar.gz", "has_sig": false, "md5_digest": "1e7839bc432e4215664226bd4a940fd7", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 6964, "upload_time": "2019-09-08T04:46:52", "url": "https://files.pythonhosted.org/packages/90/cb/b1f6147c259439a3ff779606ef1e72b746732e275711af7e933bb6542edc/pixelsort-0.0.1.tar.gz" } ], "0.0.10": [ { "comment_text": "", "digests": { "md5": "ff6b3c747b18e18f2f1c406d6688e562", "sha256": "50518736ca2c41b94ce2fcbe0afa9e71e3431f4d654bd2da0eb61f48ca6e909c" }, "downloads": -1, "filename": "pixelsort-0.0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "ff6b3c747b18e18f2f1c406d6688e562", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9406, "upload_time": "2019-09-08T04:46:15", "url": "https://files.pythonhosted.org/packages/b6/97/0bbdd274df85b2d2d6c9a8695d8e7b65f354f6d0be4932c9d44842f6dad4/pixelsort-0.0.10-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ff6b3c747b18e18f2f1c406d6688e562", "sha256": "50518736ca2c41b94ce2fcbe0afa9e71e3431f4d654bd2da0eb61f48ca6e909c" }, "downloads": -1, "filename": "pixelsort-0.0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "ff6b3c747b18e18f2f1c406d6688e562", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6", "size": 9406, "upload_time": "2019-09-08T04:46:15", "url": "https://files.pythonhosted.org/packages/b6/97/0bbdd274df85b2d2d6c9a8695d8e7b65f354f6d0be4932c9d44842f6dad4/pixelsort-0.0.10-py3-none-any.whl" } ] }