@pixelsorter is a Twitter bot written in Ruby heavily utilizing EVA-01/pxlsrt and mispy/twitter_ebooks. It sorts the rows (or optionally columns) of an image according to a specific method like hue, red, brightness, luma, etc. Simply attach an image to your tweet (links to images currently not supported) and mention @pixelsorter. @pixelsorter will respond with an image that has been processed using one of a number of random presets.
There are a number of presets available. You can specify a preset by including the string preset[]
with the name of the preset between the brackets. For example, to use the "drip" preset, you would include preset[drip]
. If @pixelsorter can't find your preset, it will default to a random preset. Below are a list of presets, sample images, and how you would reproduce them using `cmd[]`, but note that the end effect varies highly depending on the image. I encourage you to experiment!
If you do not specify a preset[]
nor cmd[]
when giving an image to @pixelsorter, a random preset will be chosen along with a slight "shaking" of the parameter values, making sure that random results you get are not identical/boring. If you specify a preset directly, this shaking will not occur.
cmd[middle 2 vertical true]
cmd[middle 5 max 90 min 80 reverse true]
cmd[max 300 min 600 method luma diagonal true reverse true]
no parameters passed
cmd[vertical true max 80 min 10 smooth true method uniqueness]
cmd[middle -3 max 50 min 49 vertical true method saturation]
cmd[vertical true max 300 min 600 method saturation]
cmd[middle -2 max 20 min 10]
cmd[middle 10 max 350 min 350 diagonal true reverse true]
cmd[middle 3 max 300 min 240 diagonal true]
You can pass custom parameters to @pixelsorter by including cmd[]
in your tweet with a set of parameters between the brackets. Parameters will always come in key-value pairs and should look something like cmd[max 50 min 20 diagonal true]
. You should always have an even number of words between the brackets. If you pass an invalid value as a parameter, @pixelsorter will not respond.
Here are the custom parameter details (mostly a rewriting/copy of the docs in EVA-01/pxlsrt):
method <string>
- the method by which to sort pixels. sum-rgb
by default. Don't actually include the brackets (< and >). There are a number available:
sum-rgb
- sorts by the sum of the red, green, and blue values of the pixelsred
- sorts by the red value of the pixelsgreen
- sorts by the green value of the pixelsblue
- sorts by the blue value of the pixelssum-hsb
- sorts by the sum of the hue, saturation, and brightness values of pixels. smoothing option is suggested for this method. smooth true
is suggestedhue
- sorts by the hue value of the pixels, looks like a rainbow. smooth true
is suggestedsaturation
- sorts by the saturation value of the piexls, looks like bands fade to grey. smooth true
is suggestedbrightness
- sorts by the brightness value of the pixelsuniqueness
- sorts by the "distance" of the pixel from the average color of the bandluma
- sorts by human color perceptionrandom
- randomizes the pixelsmagenta
- sorts by a magenta valuecyan
- sorts by a cyan valueyellow
- sorts by a yellow valuealpha
- sorts by the opacity of a pixelsum-rgba
- sorts by the sum of the red, green, blue, and alpha valuessum-hsba
- sorts by the sum of the hue, saturation, brightness, and alpha valuesmin <integer>
- minimum length of bandwidth to sort, 1 to infinity--by default is infinity. Don't pass infinity manually, as @pixelsorter doesn't accept a string for this param
min <integer>
- maximum length of bandwidth to sort, 1 to infinity--by default is infinity. Don't pass infinity manually, as @pixelsorter doesn't accept a string for this param
vertical <boolean>
- will sort vertically instead of horizontally. false
by default
smooth <boolean>
- places identical pixels adjacent to each other in the band. false
by default
reverse <boolean>
- sorts in reverse. false
by default
diagonal <boolean>
- sorts diagonally. false
by default
middle <integer>
- "middlates"--essentially creates a mirror effect by sorting from the middle out. If you pass 1
, you'll have a mirror effect. If you pass more, you'll get a duplicated mirror effect. Negative numbers will cause interesting ripple effects. By default, middle
is disabled. Numbers greater than 20 or less than -20 are capped because of the memory-intensiveness of this operation.
You can have @pixelsorter return the full, high-resolution version of your image. Ordinarily @pixelsorter will download the default medium size of your image that is displayed on twitter, but if you include the string hires
in your tweet, @pixelsorter will download and return the largest available image. hires
should be included outside of cmd[]
or preset[]
. For example, these two tweets would return high resolution images:
@pixelsorter cmd[vertical true] hires
@pixelsorter preset[drip] hires
Wandered here from somewhere on the internet? Glitchet is a free futuristic technology email newsletter and a software/glitch art resource hub. You might like some glitch art tutorials or the newsletter.
Any feedback and suggestions can be sent to @wayspurrchen. Longer format stuff can be sent to wayspurrchen at gmail dot com.