https://github.com/kociumba/kpixel
Pixel sorting in go with options for column and row sorting
https://github.com/kociumba/kpixel
cli go golang pixel-sorter pixel-sorting
Last synced: 4 months ago
JSON representation
Pixel sorting in go with options for column and row sorting
- Host: GitHub
- URL: https://github.com/kociumba/kpixel
- Owner: kociumba
- License: mit
- Created: 2024-04-27T19:35:46.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-19T17:48:14.000Z (over 1 year ago)
- Last Synced: 2025-01-22T01:15:01.083Z (about 1 year ago)
- Topics: cli, go, golang, pixel-sorter, pixel-sorting
- Language: Go
- Homepage: https://ksuite.framer.website
- Size: 131 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#
Welcome to
## Overview
I got inspired by the YouTube video by Acerola on pixel sorting.
So I made my own implementation in go, this is by no means feature complete.
Kpixel is a part of my K suite of tools that so far includes:
- [Ktool](https://github.com/kociumba/ktool)
- [Ksorter](https://github.com/kociumba/ksorter)
- [Kinjector](https://github.com/kociumba/Kinjector)
- [Kpixel](https://github.com/kociumba/kpixel) - this repo
## Installation
Right now the only way to install is to compile it yourself which only requires [go](https://go.dev/dl/).
I will create a scoop manifest for it in the future.
## Usage
> [!IMPORTANT]
> for `-sort column` and `-sort row` the `-method` flag is requred, for `-sort random` the `-chunk` flag defines the size of the chunks in pixels e.g. `-sort random -chunk 100` will divide the image in to 100x100 chunks.
`-sort` defines the way we sort pixels, options are:
> - `column` (sorts pixels in respective columns, preserves vertical elements)
> - `row` (sorts pixels in respective rows, preserves horizontal elements)
> - `random` (randomly sorts pixels in chunks)
`-chunk` number of chunks to divide the image in to when using random sort defaults to 10 (only relevant if using random sort)
> [!NOTE]
> if the chunk size is bigger than the width of the image in pixels the whole image gets randomised and essentially becomes noise
`-method` defines the value that is used to sort the pixels, options are:
> - `hue` (very noisy)
> - `luminosity` (smooth and looks good)
> - `saturation` (kinda buggy, needs more testing)
> - `red` (looks good depending on the image)
> - `green` (looks good depending on the image)
> - `blue` (looks good depending on the image)
> [!IMPORTANT]
> always pass the path to the image you want to sort as the last argument
>
> if you don't pass the image path, a file picker will open prompting you to pick an image
Output always goes into the folder of the original image with a .sorted extension to indicate that it has been sorted.