Skip to content

Pixel sorting in go with options for column and row sorting

License

Notifications You must be signed in to change notification settings

kociumba/Kpixel

Repository files navigation

Welcome to

Kpixel

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:

Installation

Right now the only way to install is to compile it yourself which only requires go.

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.