A port of sug0/go-glitch

Related tags

Command-line glitch
Overview

Glitch

This is a simple port of https://github.com/sug0/go-glitch to rust.

What is the deal with the expressions?

You can think of the image as a functor that you map an expression to, for each pixel's component colors, returning a new one. The allowed operators are:

Custom operators

  • t a pixel made up of a random color component from the neighboring 16 pixels
  • g a pixel made up of a random color component from random locations in the image
  • r{Num} a pixel made up of a random color component from the neighboring Num pixels
  • R{Num} the red color component defined by Num (i.e. R255 is the same as R)
  • G{Num} the green color component defined by Num (i.e. G255 is the same as G)
  • B{Num} the blue color component defined by Num (i.e. B255 is the same as B)

Ported from go-glitch

  • + plus
  • - minus
  • * multiplication
  • / division
  • % modulo
  • # power of operator
  • & bit and
  • | bit or
  • : bit and not
  • ^ bit xor
  • < bit left shift
  • > bit right shift
  • ? returns 255 if left side is greater otherwise 0
  • @ attributes a weight in the range [0, 255] to the value on the left

The expressions are made up of operators, numbers, parenthesis, and a set of parameters:

  • c the current value of each pixel component color
  • b the blurred version of c
  • h the horizontally flipped version of c
  • v the vertically flipped version of c
  • d the diagonally flipped version of c
  • Y the luminosity, or grayscale component of each pixel
  • N a noise pixel (i.e. a pixel where each component is a random value)
  • R the red color (i.e. rgb(255, 0, 0))
  • G the green color (i.e. rgb(0, 255, 0))
  • B the blue color (i.e. rgb(0, 0, 255))
  • s the value of each pixel's last saved evaluated expression
  • r a pixel made up of a random color component from the neighboring 8 pixels
  • e the difference of all pixels in a box, creating an edge-like effect
  • x the current x coordinate being evaluated normalized in the range [0, 255]
  • y the current y coordinate being evaluated normalized in the range [0, 255]
  • H the highest valued color component in the neighboring 8 pixels
  • L the lowest valued color component in the neighboring 8 pixels

Examples

  • 128 & (c - ((c - 150 + s) > 5 < s))
  • (c & (c ^ 55)) + 25
  • 128 & (c + 255) : (s ^ (c ^ 255)) + 25
You might also like...
A simple demo to bind a TCP port with k8s exec channel.k8s.io websocket API.

k8s-webterm-connector Tired with web terminals? Let's use it with CLI! This is just a simple demo to bind a TCP port with k8s exec websocket API, whic

🧮 Boolean expression evaluation engine. A Rust port of boolrule.

coolrule My blog post: Porting Boolrule to Rust Boolean expression evaluation engine (a port of boolrule to Rust). // Without context let expr = coolr

Truly universal encoding detector in pure Rust - port of Python version

Charset Normalizer A library that helps you read text from an unknown charset encoding. Motivated by original Python version of charset-normalizer, I'

Experimental engine agnostic 3D CSG library for game development written in Rust. Started as a port of csg.js to Rust.

brusher Experimental engine agnostic 3D CSG library for game development written in Rust. Started as a port of csg.js to Rust. ultimate goal My hope i

Utility to glitch and dump an AirTag

Airtag dumper Simple utility to glitch and dump the nRF52832 firmware on an airtag using cheap hardware. Requirements: An airtag A bluepill STM32F103

A cross-platform serial port library in Rust. Provides a blocking I/O interface and port enumeration including USB device information.

Note: This is a fork of the original serialport-rs project on GitLab. Please note there have been some changes to both the supported targets and which

An app which reads data from a serial port and serves it on a TCP port.

serial-to-tcp An app which reads data from a serial port and serves it on a TCP port. How to use Clone this repo and build the app as outlined below (

🤖 The Modern Port Scanner 🤖
🤖 The Modern Port Scanner 🤖

➡️ Discord | Installation Guide | Usage Guide ⬅️ The Modern Port Scanner. Fast, smart, effective. 🐋 Docker (Recommended) 👩‍💻 Kali / Debian 🏗️ Arch

Rust port of pexpect

rexpect Spawn, control, and respond to expected patterns of child applications and processes, enabling the automation of interactions and testing. Com

A Rust port of the password primitives used in Django Project.

Rust DjangoHashers A Rust port of the password primitives used in Django Project. Django's django.contrib.auth.models.User class has a few methods to

Rust port of simdjson

SIMD Json for Rust   Rust port of extremely fast simdjson JSON parser with serde compatibility. readme (for real!) simdjson version Currently tracking

Rust port of gjson,get JSON value by dotpath syntax

A-JSON Read JSON values quickly - Rust JSON Parser change name to AJSON, see issue Inspiration comes from gjson in golang Installation Add it to your

A complete harfbuzz's shaping algorithm port to Rust

rustybuzz rustybuzz is a complete harfbuzz's shaping algorithm port to Rust. Matches harfbuzz v2.7.0 Why? Because you can add rustybuzz = "*" to your

A native Rust port of Google's robots.txt parser and matcher C++ library.

robotstxt A native Rust port of Google's robots.txt parser and matcher C++ library. Native Rust port, no third-part crate dependency Zero unsafe code

A cross-platform serial port library in Rust.

Introduction serialport-rs is a general-purpose cross-platform serial port library for Rust. It provides a blocking I/O interface and port enumeration

Pure Rust port of CRFsuite: a fast implementation of Conditional Random Fields (CRFs)

crfs-rs Pure Rust port of CRFsuite: a fast implementation of Conditional Random Fields (CRFs) Currently only support prediction, model training is not

Rust port of sentence-transformers (https://github.com/UKPLab/sentence-transformers)

Rust SBert Rust port of sentence-transformers using rust-bert and tch-rs. Supports both rust-tokenizers and Hugging Face's tokenizers. Supported model

Fast 2D Delaunay triangulation in Rust. A port of Delaunator.

delaunator-rs A very fast static 2D Delaunay triangulation library for Rust. A port of Delaunator. Documentation Example use delaunator::{Point, trian

port of MapBox's earcut triangulation code to Rust language
port of MapBox's earcut triangulation code to Rust language

Earcutr This is a port of the MapBox company's Earcut computer code, which triangulates polygons. Please see https://github.com/mapbox/earcut for more

Comments
  • Quality of life changes and error handling

    Quality of life changes and error handling

    1. Format the code with cargo fmt
    2. Apply suggestions from cargo clippy
    3. Improve error handling with anyhow
    4. Allow saving images to stdout
    5. Other misc changes
    opened by sug0 0
  • feat: Display image in the terminal if available

    feat: Display image in the terminal if available

    Kitty + wezterm + wayst all support this, I'm working on a rust library to implement kitty's Terminal Graphics Protocol, so ideally we can use that and render images directly in the terminal. We can fall back on opening the image with the default OS application

    opened by PThorpe92 0
  • Add examples

    Add examples

    README needs a few good examples. I feel like you have some really good ones already done. But maybe show the before:after with the expression/command that produced it?

    documentation good first issue 
    opened by PThorpe92 0
Releases(v0.2.0)
Owner
Helba
Creator of BlizzTrack and many other tools
Helba
Dog command for *nix systems, Rust port of dog.

dog-rs Dog command for *nix systems, Rust port of dog. Because there is a cat command, should be a dog command too. It was written completely using VS

Juanjo Salvador 2 Sep 29, 2021
Rust port of InfectedRose.Interface

Rust port of Wincent's InfectedRose.Interface. It is not finished; only adding to the database is possible at the moment, editing and removing is not,

zaop 3 Feb 2, 2022
This is a command line port of the game Wordle in Rust

Wordle.rs Welcome to Wordle.rs! This is a command line port of the game Wordle in Rust. I built this in order to get more familiar with programming in

Brock Herion 5 Apr 8, 2022
A Rust port of the command line program playing with the cutscenes files (USM) from Genshin Impact.

GI-cutscenes : Rust Remix A command line program playing with the cutscene files (USM) from Genshin Impact, reimplemented in Rust. Much like its origi

Lymkwi 5 Nov 6, 2022
Rust port of https://github.com/hunar4321/life_code with some fun features.

Smarticles A Rust port of Brainxyz's Artificial Life simulator with some fun features. A simple program to simulate primitive Artificial Life using si

Chevy Ray Johnston 15 Dec 24, 2022
png_defringe_rs is a port of Immorpher's PNG Defringe program written in Rust to achieve easier installation and faster performance.

png_defringe_rs png_defringe_rs is a port of Immorpher's PNG Defringe program written in Rust to achieve easier installation and faster performance. U

null 2 Nov 17, 2022
port sniffer, multithreading

SniffSniff I am trying to learn Rust programming language. Here is a small project that sniffs the ports of a given host. I want to give some info wha

Furkan Demir 5 Mar 5, 2023
`ggllama` is a Rust port of ggerganov's llama.cpp.

Notice llama-rs beat me to the punch. I'll be contributing to that instead. The original README is preserved below. ggllama ggllama is a Rust port of

Philpax 6 Mar 15, 2023
A command-line tool to easily kill processes running on a specified port.

killport killport is a command-line utility for killing processes listening on specific ports. It's designed to be simple, fast, and effective. The to

Francisco Jiménez Cabrera 6 Mar 29, 2023
A port of everything to Rust 🦀

everything.rs Do you ever feel like washing your hands after a coding session, disgusted at having to use essential Unix utilities with not the tinies

null 8 Apr 17, 2023