You are here

GIMP Octave Plugin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!

This plugin provides a simple interface between GIMP and GNU Octave.
Means you can edit a picture from GIMP in the high level numerical language Octave:
http://www.gnu.org/software/octave/

Download elsamuko-gimp-octave.c and install it with:
$ gimptool-2.0 --install elsamuko-gimp-octave.c
or download elsamuko-gimp-octave.tar.gz and install it with:
$ tar -xzf elsamuko-gimp-octave.tar.gz
$ cd elsamuko-gimp-octave
$ make

The second one is also able to use OctaveEmbedded instead of the Linux system call, you have to change the
#define USE_OCTAVE_EMBEDDED FALSE
in the file elsamuko-gimp-octave.cpp at line 48 to TRUE before compiling with make. But since OctaveEmbedded is not reentrant safe yet, it is recommended to use the system call.

You will find it then under Filters -> Mathematics -> GIMP Octave.
The input/output matrices and the Octave script are stored in ~/.gimp-octave.

For more interesting examples, download and unzip the filter pack to ~/.gimp-octave.
The filter pack needs the octave-image package which should be available in your repository.
These are from here:
http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/index.html

Søren Hauberg modified the plugin to a version with included terminal:
http://image.diku.dk/hauberg/gimp-octave-terminal/

For example in this image the red layer has been FFT-shifted by Octave (needs 5-6 secs for a 1MP image):

FFT-Shift

Another example code (needs to be fitted to the GIMP color range):
http://www.freesoftwaremagazine.com/articles/cool_fractals_with_perl_pdl...

Mandelbrot
http://www.flickr.com/photos/28653536@N07/4172347715/

Update1: Some IO fixes, OctaveEmbedded and possibility of using S/W images.
Update2: README added, some cleanup and a more general makefile in the tar packet. Default Octave script can do backup files optionally.
Update3: Some internal fixes && clean-up.

For all scripts together, go here:
http://sites.google.com/site/elsamuko/gimp

GIMP Version: 
Code License: 

Comments

Well I have reverted my Mepis installation to just before I started messing about with this, so the Octave packages + a load of extra stuff I hoped might work have gone,
However
The libgtk dev 2.12.12-1~lenny1 is still there and I can confirm that the gtkdialog.h file is there and installed in /usr/include/gtk-2.0/gtk/

No problem, I can wait for updates and it is not too uncommon for some things to work on Ubuntu and not on Mepis.

rich

I put a binary here:
http://sites.google.com/site/elsamuko/gimp/gimp-octave
But I really recommend to compile it.

Thank you once more for trying.

As suspected the binary crashes in my Mepis 8 installation. As before Mepis is rock solid but more mainstream debian than Ubuntu so it was no surprise.

I will give it a rest for now but one query that might help others. There are several versions of Octave and I assumed the most recent Octave3 - is this correct?

rich

The binary is calling Octave via:
system("octave --silent ~/.gimp-octave/gimp.m");
Means, you don't need a special Octave version to run this plugin.
But it's a 32bit binary, so if you have a 64bit machine, it won't run.
But I think, that with the next Mepis update, it will be possible to compile the source.

Greetings
elsamuko

PS: I took GIMP's unsharp-mask.c as plugin template and the "gtk_dialog_get_content_area" expression is from it:
http://git.gnome.org/cgit/gimp/tree/plug-ins/common/unsharp-mask.c

Pages

Subscribe to Comments for "GIMP Octave Plugin"