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

this fails with this
/tmp/ccp874Ek.o: In function `octave_dialog':
elsamuko-gimp-octave.c:(.text+0x922): undefined reference to `gtk_dialog_get_content_area'
collect2: ld returned 1 exit status

I am no code expert so need help.

using gimp 2.6.7 - Mepis8 (debian)

rich

Do you have the dev packets for gtk and GIMP installed:
sudo apt-get install libgimp2.0-dev libgtk2.0-dev

certainly looks like they are installed

Reading state information... Done
libgimp2.0-dev is already the newest version.
libgtk2.0-dev is already the newest version.

rich

Then the needed function should be here:
> cat /usr/include/gtk-2.0/gtk/gtkdialog.h | grep gtk_dialog_get_content_area
and give this result:
> GtkWidget * gtk_dialog_get_content_area (GtkDialog *dialog);

This is not looking good

No result from the above cat /usr.........
so I had another look at source files via synaptic and I did not have
gtkdialog
also
glibc-source
installed them both and the result is the same.

rich

I have it here:
http://packages.ubuntu.com/search?suite=default&section=all&arch=any&sea...
Maybe you can download and manually install the libgtk2.0-dev packets from Debian or Ubuntu:
http://packages.ubuntu.com/karmic/libgtk2.0-dev

libgtk2.0-dev was already there.
From the parameters that are passed for building the plugin I made sure that the dev packages for these were installed
gtk-2.0, glib-2.0, libatk-1.0, cairo, libpango-1.0, libpixman-1, libfreetype2, libdirectfb, libpng12 (plus a few more that maybe have a bearing on the issue)

The only exceptions may be the dev packages of
libfreetype6 & libcairo2 - these are the only ones available & are installed..

I still get
elsamuko-gimp-octave.c:(.text+0x922): undefined reference to `gtk_dialog_get_content_area'
collect2: ld returned 1 exit status

I have compiled other plugins, so I know that the procedure can work. I am wondering if this is maybe a Gnome / KDE thing.

rich

Like I said, the needed file is in the libgtk2.0-dev package, but somehow it's missing in the Mepis one. You may try to download and install the Debian/Ubuntu package:
http://packages.ubuntu.com/en/karmic/libgtk2.0-dev
http://packages.debian.org/lenny/libgtk2.0-dev
Or you could try to reinstall the libgtk2.0-dev package. If it's still not there, ask the Mepis maintainer about it or install the Debian/Ubuntu package:
For 32 Bit:
> wget http://ftp.ussg.iu.edu/linux/ubuntu/pool/main/g/gtk+2.0/libgtk2.0-dev_2....
> sudo dpkg -i libgtk2.0-dev_2.18.3-1_i386.deb

Good luck.

Like I said libgtk2.0-dev (2.12.12-1~lenny1) is already installed.

I had a look at enabling the debian volatile repo to try 2.18.3 but to upgrade to gtk2.0_2.18.3 'packages' would require removal of so much - from Amorak to Xvidcap - as to make not worthwhile.

Thanks for the help.

rich

The file gtkdialog.h is also in the 2.12.12-1~lenny1 package:
http://packages.debian.org/lenny/libgtk2.0-dev
http://packages.debian.org/lenny/i386/libgtk2.0-dev/filelist
Try to reinstall it.

Pages

Subscribe to Comments for "GIMP Octave Plugin"