because there is not yet an FFI-subForum, I post this here.
I wrote an app (LiveCode standalone) that may go in the direction of what LC will give us soon with it's FFI-interface. It is a GUI to the fastest easy accessible interface I know:
LuaJIT, a jewel of development artwork, the cream of cream in development software.
Most of it is written in "made-to-measure"-Assembler and thus faster than native compiled C. What we use is available JIT (just in time), it has simply to be prepared to very basic Lua and some LuaJIT requirements, see http://luajit.org .
The GUI I wrote using LiveCode, does that for you in a lot of cases, there is only for advanced users a module that allows to script the core of the procedures: Yes, you write it in a field and it is then just in time done by LuaJIT!
The app is still in early beta, only small help is available. It is good to know (but you don't have to) what imagedata is.
hhImageJIT v3b5 (LiveCode-GUI using the LuaJIT-FFI)
It's free, just try.
[The apps are closed source, will become open source when finished.]
Change RGB-channels and apply a 3x3-color-matrix to each pixel (example usage: Sepia effect).
Apply 3x3-5x5-7x7 matrices for 1 to 3 of the channels (example usage: Embossing).
Apply Median (or other quantiles) filtering from a 3x3 up to a 33x33 surrounding area for each pixel and selected RGB-channels (example usage: Despeckle).
- Transform (advanced, needs basic Lua).
Apply math-transforms (example usage: whirl or wave).
- Advanced (expert level: Touch the CORE).
Act by script on each channel of each pixel (and its surrounding pixels).
Very simple, write the following 5 lines to the input field and click "Do Field".
Code: Select all
-- your core script for changing color channels -- from RGB to BRG (Lua syntax) for i=0,n-1 do img[i].r=im[i].b img[i].g=im[i].r img[i].b=im[i].g end -- n=number of pixels (you don't have to give) -- x is one of r, g, b -- im[i].x = channel x of input pixel i, zero based -- img[i].x = channel x of output pixel i, zero based
Each module is shown/hidden by clicking its name. Clicking one of the 12 small squares at right determines the location on screen.
Clicking the big status oval (yellow, green, hopefully never red) compacts the module window.
At topLeft there are small buttons, for example for a calculator, in case you need one for your input.
QUIT hhImageJIT: Close the main window / use the main menu.
Extract the downloaded zip to any directory. Inside the expanded folder don't change the directory structure. You'll get:
[+] On all platforms
hhImageJit = the app, should work by double-click
hhImagesIN = directory of sample images, for later speed comparison
(the WS-images are from a Wilhelm-Sanke-stack, RichMedia-forum).
hhImagesOUT = directory for your saved artwork
hhPrefs = contains templates for personal menus (edit in a TextEditor).
[+] on Linux additionally
= a directory "fonts" containing three ttf-files which the app needs. Please install these fonts if they are not already in your OS.
= directories "Externals" and "Linux" and a file revsecurity.so (don't touch these).
[+] on Windows additionally
= a directory "fonts" that is used by the app (perhaps you have to install the fonts).
= directories "Externals" and "Win32" and a file revsecurity.dll (don't touch these).
[There are also standalones for RaspiB, Raspi2 and Raspi3. The gain in speed is extreme on these machines!
As the source cannot be closed there, the zips are password-protected and I'll give them out under certain conditions to certain persons only. Just ask me via email.
And I'll prepare also versions for iOS and Android later on, but you will never be able to use them or later on my source code via 'official ways', because Apple and Google are very afraid of just-in-time compilation.]
The downloads are at about 15 MByte each (incl. 7 MByte images)
MacOS. Tested on 10.6-10.11 (for 10.12 see +++ below)
Linux. Tested on Debian, Mint, Lubuntu, Xubuntu.
Windows. Tested on Windows 7/8/10.
If you have problems or questions, please ask here in this thread.
Have fun with your artwork!
[+++ Edit: No more crash on 10.12 beta 3]