Image creation and manipulation toolkit..
So PixelWrench started like most of my projects as a tool to easily write pixels to a surface and save that surface to a file. Originally the main goal was to generate a frame of black and white static and then possibly compile those frames into a video stream. There are a few projects that could accomplish this, but none of them exactly fit the bill for what I wanted to accomplish.
| Package Name | Website |
|---|---|
| Cairo | https://cairographics.org/ |
| OpenCV | https://opencv.org/ |
| Cinder | https://libcinder.org/ |
| PyCairo | https://cairographics.org/pycairo/ |
| Processing | https://processing.org/ |
| ImageMagic | https://www.imagemagick.org/ |
| Magic++ | https://www.imagemagick.org/Magick++/ |
| GD | https://libgd.bitbucket.org/pages/about.html |
I wanted to try to create the application myself in a scripting language that felt comfortable and expressive, and I already had a decent set of C++ classes of boilerplate code for AngelScript integration. The project quickly moved passed being able to set a pixel on a surface to a full fledged image processing and drawing scripting language, expanding into areas like computer vision and video frame extraction and creation. It became a sandbox for manipulating images as matrices and applying text and vector rendering layers.
I have made every effort not to use non-platform specific code, application is currently building on win32 and Linux64.
The environment for running pskrit files is very dependency heavy ( around 100mb ) in order to support all the features I wanted. LibAV codec is 40mb on it's own.
WARNING: Every attempt has been made to catch and report exceptions but since exceptions do not propagate across shared library boundaries dependencies still can throw an unhandled exception that crashes the application. I've done my best to make sure data passed to external libraries is properly sanity checked but the possibility still exists for an external lib to bring down the environment. If you report a crash any shared library information would be helpful.
The main script in PixelWrench is called a pixelSkrit file:
doSomething.pskrit
pskrit files can contain includes called ' lug ' files:
tests.lug
so a basic pskrit file may look like:
Of course since PW includes a fully compliant C99 preprocessor, all the macro functionality is available to you ( https://en.wikipedia.org/wiki/C_preprocessor ). For vector rendering PW leverages Cairo, so an overview of the Cairo framework is useful ( https://cairographics.org/samples/ )
Channel separation: red / green / blue
*see the DirScanner example for usage
Searching for files uses the predicate idiom and the AngelScript interface functionality.
First define a class that will handle when a file name is matched:
Then pass the class to the scanner, and run it:
Processing supported file: Lake Street Dive Plays _I Want You Back_ On a Boston Sidewal.mp4
You can initiate a remote debugging session by using the switch -d with a port number, and then use the HTML client to connect and step though code:
A few years ago the tool was rewritten to be used as a Python module on Windows and Linux still maintaining it C++ core. Most recently ported to Rust and utilizing the Rune scripting language.