OSS development
January 31, 2006 at 8:19 am | In GIMP, Ramblings | Leave a CommentRecently I found the following comment on a GIMP forum.
“If you have any thoughts about using the Image Map tool in GIMP to create an image map, my advice is: don’t bother. It’s FULL OF BUGS! I created ONE area for an image (admittedly with quite a few points), saved it, and when I reopened it the area was totally messed up! Points were moved to strange locations, lines overlapped. It’s also extremely cumbersome and slow to use. Clicking on a line to add a point is practically impossible (it took me over 20 tries one time to click the line just right). In sum, it’s a total waste of time.“
Now, why would I bother with this? Well, I created the Imagemap plug-in back in 1998 and it has been part of the GIMP distribution since release 1.2. Continue reading OSS development…
Working on GIMP# 0.8
January 30, 2006 at 9:32 am | In GIMP | Leave a CommentWe want to release GIMP# 0.8 by the end of february. There will be a few user visible changes and a some changes that will only be appreciated by developers.
To start with the former:
- There is a new plug-in to generate beautiful swirlies.
- The Splitter plug-in will work as advertised. This plug-in has been included in the last few releases, but the formula evaluation never worked since it wasn’t implemented. An example of the results of this plug-in can be seen at the end of this post.
- The wbmp (Wireless bitmaps) plug-in can now also save images.
- All GIMP# plug-ins can now be called from within your own scripts.
Changes only visible to developers:
- The API of the base class Plugin has become a lot cleaner. I have done a lot of code refactoring and marshalling details are no longer visible in the derived plug-ins.
- More coverage of the GIMP API.
- Finally there will be some documentation
The example, before the split:

And after splitting it with f(x, y): h/2 – h/8 * cos(x * 8 * pi / w) – y and some rotation and translation:

Java trigonometry performance sucks
January 25, 2006 at 9:46 am | In Programming | 4 CommentsJust did some benchmarking on creating swirlies both in Java and C#. The code is almost completely similar. I create a 200 x 200 pixel image and the results are somewhat shocking: in Java this takes 36.7 seconds while in C# only 10.2 seconds are needed. That’s almost 4 times as fast!
At first I thought I had made some trivial mistake in my code, since I’ve never seen such differences before. However when I looked at other benchmarks, for example this one it soon became clear that Java performance with trigonometry is bad, compared to most other programming languages. And swirlies happen to be full of trigonometric functions.
I hope this will be solved in the coming Mustang release but this is quite unlikely. in this blog it is explained that Java favors accuracy over speed. And one final remark: Mono was only 10 percent slower than .NET 2.0, which is not bad.
C# versus Java versus C performance
January 24, 2006 at 9:55 am | In GIMP, Programming | Leave a CommentAlways a nice topic: my language is faster than your language. In the past we have seen C versus C++, Java versus C++, C# versus Java, Lisp versus C. And probably every other performance comparison you can possibly think of.
And now comes my contribution to his topic. I have downloaded some C code to generate so called swirlies (see one my previous posts). This is a very CPU intensive task. For my GIMP# plug-in I’m going to translate this code to C# and do some measurements. It’s also very easy to translate this to Java. The results will be up here in a few days, so we can settle once and for all which is the best programming language
Well, at least performance wise.
Btw, in the past I’ve done similar measurements on small pieces of code and never noticed any substantial differences between C# and Java. Sometimes Java was 10 % faster, sometimes C#. Nothing to get excited about.
Can your heart predict the future?
January 23, 2006 at 9:22 am | In Ramblings, skepticism | 6 CommentsOf course not! But according to this article from the Instute of HeartMath it can. Your heart rate reacts on events that take place about 4.5 seconds later. Now before you get enthousiastic over this and get visions of making fortune in the casino with a simple heart rate monitor, let me share my opinion on this subject with you. First I will explain their test setup.
Each participant gets to see a series of 45 pictures. In this series there is a change of 2/3 of an calm picture and 1/3 of an emotional (violence, sexual content, etc.) picture. The participant first clicks on a button and then 6 seconds later either a calm or emotional picture appears. And the `suprising’ part is that the heart already knows about 4.5 seconds in advance which of the two types of pictures this is going to be. Amazing!
More work on GIMP#
January 20, 2006 at 10:14 am | In GIMP | Leave a CommentMy pet project at the moment is GIMP#. For the next release (0.8) I’m finishing the Splitter plug-in. The old version for GIMP 1.x used to be in C, but it is now almost completely ported to C#. Instead of having to mess with Yacc and Lex to parse formulas I can now use on-the-fly compilation with the additional bonus that this is much faster.
Another addition to GIMP# is going to be the swirlies plug-in. I have been wanting to do this for ages, but I lost the reference to the source code. An example of a swirly:

C# generics
January 19, 2006 at 10:04 am | In Programming | 3 CommentsUsing generics in combination with anonymous methods is pretty cool. This makes C# almost as fun as my favorite language: Scheme! However, I really don’t understand why the List class has an Exists method where you can define a predicate function, while the Dictionary class is missing such a method.
And our next camera (?):

It had to happen
January 18, 2006 at 12:15 pm | In Ramblings | Leave a CommentSince everyone is blogging, it had to happen. Now I’m blogging too
I wonder how much time it takes before Laura adds a comment here…
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.