Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mhseiden/pixel-sorting-c

A command line tool for pixel sorting your images, written in C / C++
https://github.com/mhseiden/pixel-sorting-c

Last synced: about 2 months ago
JSON representation

A command line tool for pixel sorting your images, written in C / C++

Awesome Lists containing this project

README

        

# pixel-sorting-c

A command line tool for pixel sorting your images, written in C.

![cubing](http://i.imgur.com/DktAGw9.jpg)

## Getting Started
You'll need [libjpeg](http://libjpeg.sourceforge.net/) and GCC 4.7 to compile
the binaries. Once you've handled the dependencies and successfully run `make`,
you can pixel sort you images! Note that libjpeg is under the GPL, so I'm not
including it directly in the repo.

## CLI Tool Usage
``usage: pixelsort [source.jpg] [destination.jpg] ""``

## Query Syntax
A query takes the following form:

```SORT [ROWS|COLS] [ASC|DESC] BY [AVG|MUL|MIN|MAX|XOR] WITH [FULL|FIXED |DARK |LIGHT ] RUNS```

+ The `[ROWS|COLS]` distinction sets the "run" type (sort row-wise or col-wise).
+ The `[ASC|DESC]` distinction sets the ordering direction for the comparator.
+ The `BY [...]` clause states how a numeric value is extracted from a pixel.
+ The `WITH [...] RUNS` clause states how run boundaries are computed.

Note that multiple queries can be strung together using the `THEN` keyword. This enables easy chaining of operations without having to write the buffers to disk between each run.

Also note that the query must be quoted when submitted to the CLI Tool, since it should interpreted as a single string.

## Examples
+ [pixelsort'd Van Gogh](http://imgur.com/a/kmtxm)
+ [cubing "The Scream"](http://imgur.com/DktAGw9)

## Next Steps
The goal is to add on as many interesting, exciting pixel sorting algorithms as can be conjured up from the internets' collective imagination! Additionally, it would be great to develop the query language to support some high-level transformations - for example [cubing](http://imgur.com/DktAGw9) could be a single operation. Fractal patterns would be great as well.

## Contributors
Max Seiden <[email protected]>

## License
The MIT License (MIT)

Copyright (c) <2014> Max Seiden <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.