{"id":19620590,"url":"https://github.com/rusticflare/pixel-sorter","last_synced_at":"2025-04-28T03:32:10.089Z","repository":{"id":53016926,"uuid":"346778262","full_name":"RusticFlare/pixel-sorter","owner":"RusticFlare","description":"A command line app for pixel sorting images","archived":false,"fork":false,"pushed_at":"2023-04-08T09:19:25.000Z","size":8314,"stargazers_count":80,"open_issues_count":2,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-05T05:51:09.530Z","etag":null,"topics":["art","cli-app","glitch-art","glitch-effect","glitchart","glitched-images","glitchify-images","glitching","image-manipulation","image-manipulator","kotlin","npm","npm-package","pixel-sorter","pixel-sorting-images"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RusticFlare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-11T17:09:51.000Z","updated_at":"2025-01-10T03:29:29.000Z","dependencies_parsed_at":"2023-02-10T12:15:42.877Z","dependency_job_id":null,"html_url":"https://github.com/RusticFlare/pixel-sorter","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RusticFlare%2Fpixel-sorter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RusticFlare%2Fpixel-sorter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RusticFlare%2Fpixel-sorter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RusticFlare%2Fpixel-sorter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RusticFlare","download_url":"https://codeload.github.com/RusticFlare/pixel-sorter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251246154,"owners_count":21558759,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["art","cli-app","glitch-art","glitch-effect","glitchart","glitched-images","glitchify-images","glitching","image-manipulation","image-manipulator","kotlin","npm","npm-package","pixel-sorter","pixel-sorting-images"],"created_at":"2024-11-11T11:19:21.111Z","updated_at":"2025-04-28T03:32:06.645Z","avatar_url":"https://github.com/RusticFlare.png","language":"Kotlin","funding_links":["https://ko-fi.com/P5P542WTU","https://github.com/sponsors/RusticFlare"],"categories":[],"sub_categories":[],"readme":"# pixel-sorter\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/P5P542WTU)\n\n[![npm](https://img.shields.io/npm/v/@rusticflare/pixel-sorter)](https://www.npmjs.com/package/@rusticflare/pixel-sorter)\n[![License](https://img.shields.io/github/license/RusticFlare/pixel-sorter)](LICENSE.md)\n[![GitHub Sponsors](https://img.shields.io/github/sponsors/RusticFlare?style=social)](https://github.com/sponsors/RusticFlare)\n\nA command line app for pixel sorting images\n\nIf you need help, find bugs, or want a new feature:\nplease [raise an issue](https://github.com/RusticFlare/pixel-sorter/issues/new)\n\n_Inspired by [satyarth/pixelsort](https://github.com/satyarth/pixelsort/)_\n\n## Installation\n\n### Prerequisites\n\nnpm\n\n- [Install npm](https://www.npmjs.com/get-npm).\n- You are downloading the command line client that lets you install `pixel-sorter` from the npm repository\n\n### Install (and Update) `pixel-sorter`\n\n```shell\nnpm i -g @rusticflare/pixel-sorter\n```\n\n### Distro Packages\n\n#### AUR (Arch Linux)\n\n`pixel-sorter` can be installed from the [AUR](https://aur.archlinux.org/packages/pixel-sorter) using an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers). e.g.\n\n```shell\nparu -S pixel-sorter\n```\n\n## Usage\n\n### Pixel Sort Your First Image\n\nThis will pixel sort an image called `example.jpg` in your current directory and save the output in the same directory\nas `example.jpg`.\n\n```shell\npixel-sorter example.jpg\n```\n\n**Note:** A one pixel border is cropped from the output file (this is due to this pixel sorter making some of those\nouter pixels slightly transparent)\n\n\u003cdetails\u003e\u003csummary\u003eTroubleshooting\u003c/summary\u003e\n\n- **Powershell**\n    - Make sure you are running as an _Administrator_\n    - If you see this error:\n      ```shell\n      ... cannot be loaded because the execution of scripts is disabled on this system.\n      ```\n      run:\n      ```shell\n      Set-ExecutionPolicy RemoteSigned\n      ```\n      ([See this StackOverflow answer for more details](https://stackoverflow.com/a/4038991))\n\n\u003c/details\u003e\n\n### Options\n\n_See [Examples](#examples) for how to use these_\n\n|Option|Argument|Description|Default Value|\n|---|---|---|---|\n|`-p`|[A pattern](#patterns)|The patterns to sort along|`lines`|\n|`-o`|Text|The name of the output file (e.g. `sorted`)|The current date and time|\n|`-m`|File|The path to \"mask\" file|N/A|\n|`-f`|File|The path to a file to be used by the `randomfile` interval function|N/A|\n|`-a`|A number in `0.0`-`360.0`|The angle to sort along (as degrees on a compass)|`0.0`|\n|`-i`|[An interval function](#interval-functions)|The interval function to use|`lightness`|\n|`-l`|A number in `0.0`-`1.0`|The darkest `lightness` to include in sorted sections (used when the interval function is `lightness`)|`0.25`|\n|`-u`|A number in `0.0`-`1.0`|The brightest `lightness` to include in sorted sections (used when the interval function is `lightness`)|`0.8`|\n|`-w`|A positive whole number|The average width (in pixels) of the `random[file]` sorted sections (used when the interval function is `random[file]`)|`400`|\n|`-s`|[A sorting function](#sorting-functions)|The sorting function to use|`lightness`|\n|`-e`|[A filetype](#filetypes)|The extension of the filetype to output|`jpg`|\n|`-c`|A pair of integers|The center of the circle when the `circles` pattern is used|`0 0`|\n|`-r`|N/A|Reverse the sorting order|N/A|\n|`-h`|N/A|Print the help message|N/A|\n\n#### Patterns\n\n- `lines`\n- `circles`\n\n#### Interval Functions\n\n- `lightness` - pixels with a `lightness` between the `-l` and `-u` values are sorted\n- `random` - random sections of average width `-w` are sorted\n- `randomfile` - the brighter a pixel in a file provided by `-f` makes a pixel more likely to be sorted (use `-w` to\n  control the average width)\n- `none` - everything is sorted\n\n#### Sorting Functions\n\n- `hue`\n- `saturation`\n- `lightness`\n- `intensity`\n\n#### Filetypes\n\n- `jpg`\n- `png`\n\n## Examples\n\n`example.jpg`:\n\n![](examples/example.jpg)\n\n### Default\n\n```shell\npixel-sorter example.jpg\n```\n\n![](examples/example-sorted-default.jpg)\n\n### Threshold\n\nWhen using the `lightness` interval function: only pixels with a `lightness` between `-l` and `-u` will be sorted.\n\nHere we sort pixels with a `lightness` between 0.6 and 0.9:\n\n```shell\npixel-sorter example.jpg -l 0.6 -u 0.9\n```\n\n![](examples/example-sorted-l-6-u-9.jpg)\n\n### Angle 🧭\n\nYou can change the sorting angle (as degrees on a compass).\n\n```shell\npixel-sorter example.jpg -a 315\n```\n\n![](examples/example-sorted-a-315.jpg)\n\n### Circles 🟣\n\nSort circles with:\n\n- center `-200 -600` (`0 0` is the center of the image)\n- angle `210` (where the brightest and darkest pixels meet)\n- reversed sort\n\n```shell\npixel-sorter example.jpg -p circles -c -200 -600 -a 210 -r\n```\n\n![](examples/example-sorted-circles.jpg)\n\n### Mask \u0026 Random 🎭\n\nA \"mask\" file should be a black and white image (the same size as the sorted image). Only the white sections are\nconsidered for sorting.\n\n`-i random` causes random sections of the image should be sorted. You can control the average width (in pixels) of these\nsections with `-w`.\n\n`example-mask.jpg`:\n\n![](examples/example-mask.jpg)\n\n```shell\npixel-sorter example.jpg -m example-mask.jpg -a 135 -i random\n```\n\n![](examples/example-sorted-mask.jpg)\n\n### Random File\n\nThe brighter the pixel in `-f` the more likely the corresponding pixel is to be sorted.\n\n`example-randomfile-mask.jpg`:\n\n![](examples/example-randomfile-mask.jpg)\n\n```shell\npixel-sorter example.jpg -i randomfile -f example-randomfile-mask.jpg\n```\n\n![](examples/example-randomfile.jpg)\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/P5P542WTU)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusticflare%2Fpixel-sorter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frusticflare%2Fpixel-sorter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frusticflare%2Fpixel-sorter/lists"}