Code Monkey home page Code Monkey logo

pixelsort's Introduction

pixelsort

A custom GEGL operation (and by extension GIMP filter) that implements a pixel sorting effect. To use it click "Tools->GEGL Operation" and choose "Pixel Sort" in the dropdown.

This is primarily a port of the following processing script to a GEGL operation: https://github.com/kimasendorf/ASDFPixelSort

Compiling and Installing

Linux

To compile and install you will need the GEGL header files (libgegl-dev on Debian based distributions or gegl on Arch Linux) and meson (meson on most distributions).

meson setup --buildtype=release build
ninja -C build
cp build/pixelsort.so ~/.local/share/gegl-0.4/plug-ins

If you have an older version of gegl you may need to copy to ~/.local/share/gegl-0.3/plug-ins instead (on Ubuntu 18.04 for example).

NOTE: as of writing this pixelsort seems to not work with gegl-0.3. It works when run with the GEGL command line utility but for some reason none of the operation's properties show up in the GEGL tool window.

Windows

The easiest way to compile this project on Windows is by using msys2. Download and install it from here: https://www.msys2.org/

Open a msys2 terminal with C:\msys64\mingw64.exe. Run the following to install required build dependencies:

pacman --noconfirm -S base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-meson mingw-w64-x86_64-gegl

Then build the same way you would on Linux:

meson setup --buildtype=release build
ninja -C build

To install it, copy the resulting DLL (build/pixelsort.dll) to the folder where GIMP finds GEGL operations:

cp build/pixelsort.dll '/c/Program Files/GIMP 2/lib/gegl-0.4/

Or if you already have a pre-built pixelsort.dll just copy it to C:\Program Files\GIMP 2\lib\gegl-0.4\ .

Example Images

Original image:

Original image

Vertical sorting with luminance as the mode:

Original image

Horizontal sorting with white level as the mode:

Original image

Complete vertical sorting by luminance (threshold of 0):

Original image

pixelsort's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

b13rg

pixelsort's Issues

Do you plan on making more custom GEGL filters? As I have proven combinations of GEGL operations that can do cool things.

Hey it is really cool you made a custom GEGL filter. Long story short I use GEGL Sytax in a Gimp to run custom GEGL operations and here are some cool things I found. I was wondering if you would be interested in investing time in making new GEGL filters based on these ideas.

*Frosted Glass
image
Pixel Stretch Wheel
image
Comic Book Cartoon
image

Old Photo
image

text styling
image
image
image
image

If you contact me on Discord contrast#7600 I can share with you the GEGL syntax and maybe we can figure out how to get novel GEGL operations going so more people can take advantage of the best of GEGL.

Add extra modes

Add a few more sorting keys including sorting by red, green, blue, hue, saturation, value, etc. Maybe consider adding two more dropdowns for sorting with lower priority.

Different threshold mappings per mode

Currently the threshold property is the exact same floating point range for every mode. This doesn't work very well for some modes and it should be mapped to a different range accordingly.

Fix off by one

On fully sorted lines (rows or columns) there is one pixel that is not sorted.

Fix saturation threshold key

The saturation threshold key only has any effect on images when it is zero, which is not the expected behavior.

Add wrapper GIMP plugin

Currently custom GEGL ops do not appear in the GIMP filter list. The only way to make this happen is to create a GIMP plugin that simply performs the GEGL op.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.