0.0.13 • Published 7 years ago

synaesthetic v0.0.13

Weekly downloads
3
License
MPL-2.0
Repository
github
Last release
7 years ago

Syna.esth.etic

Process images with the SoX, the Swiss Army knife of audio manipulation.

Installation

npm install -g synaesthetic

Requirements

You need to have both SoX (sox) and ImageMagick (convert) installed, it should look like this

$ sox --version
sox:      SoX v14.4.1

$ convert --version
Version: ImageMagick 6.8.9-9 Q16 x86_64 2017-03-14 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC Modules OpenMP
Delegates: bzlib cairo djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png rsvg tiff wmf x xml zlib

Basic use

Pass synaesthetic an input file and an output file, followed by any arguments to SoX. Make sure the output file has a .png extension.

synaesthetic infile.jpg outfile.png treble +20

The Effects section of the SoX man page (man 1 sox) is your friend! You can chain as many transformations as you like!

synaesthetic infile.jpg outfile.png treble +20 echoes 0.7 0.8 10s 1 11s 1 dcshift 0.4

Scripted use

You can write scripts in ClojureScript for more advanced uses, see the examples/ directory for some examples.

;; your_script.cljs
(sox {:channels 2 :depth 8}
     (treble 21)
     (bass -1)
     (echos 0.7 0.8 "1s" 0.4 "1s" 1)
     (dcshift 0.2))

The syna.esth.sox namespace contains a bunch of functions you can use. Pass your script in with the -s flag.

synaesthetic -s your_script.cljs infile.jpg outfile.png

You can have syna.esth.etic watch your script with the -w flag. This will automatically re-run the script automatically re-run the it whenever it changes. If your image viewer also auto-updates then this provides a really nice workflow.

Command line switches

  • -h --help Show the help screen
  • -s --script SCRIPT_FILE The name of a ClojureScript script to run
  • -w --watch Don't exit but watch the script for changes and re-run. Use with -s.
  • -H --header SIZE Set the amount of bytes to preserve to not mess up the image header. Defaults to 512

You can use - as a file name to either read from stdout, or write to stdout.

Hashtag

Make sure to use the #synaesthetic hashtag when sharing your creations on social media!

Author

Plexus Mastodon / Patreon

0.0.13

7 years ago

0.0.11

7 years ago

0.0.9

7 years ago

0.0.0

7 years ago