Due to non-zero demand, I've packaged the source for the resizing application. Then I realised that it used my image library, which I haven't released yet, so I've also packaged it up. Then I thought - how is a person going to build all of this? They could use gcc -std=c99 *.c, but that won't work right because not all the c files are in the same directory. Of course, I was just being an idiot when I thought that, because I know that the easiest way to build all of my things is with amkel. But, the version of amkel which I released before is probably too buggy to use, so I thought version 2epsilon is due. Finally, I thought - since I'm putting up 3 things, why not make it 4? So I did the dithering source code too.
So, here they are: (all under GPL3)
I find the image library really useful. It isn't powerful at all, it just lets you write C code that looks like this:
Image img = loadImage("someImage.bmp");
imageSetPixel(img, 51, 12, 128, 192, 15);
imageSetPixelRgb(img, imageGetWidth(img) - 1, 10, imageGetPixelRgb(0, 0));
saveImage(img, "newImage.bmp");
destroyImage(img);
It might have support for some other simple file types, but I might have accidentally removed it (and even then, the interface stayed the same - it decided on the file type based on a file extension, rather than doing fancy stuff). It is great if you want to quickly try out an algorithm, and while it wasn't written to be efficient, it seems to be fast enough.
For building stuff, make sure amkel works. Type:
$ cd amkel # or where-ever you put it
$ cat > test.c
#include <stdio.h>
int main(int argc, char *argv[]) {
printf("woo\n");
return 0;
}
<ctrl+d>
$ ./amkel.rb test.c
$ ./test
And it should print 'woo'.
If you are feeling adventurous, make sure you have rubyscript2exe and tar2rubyscript installed so that amkel can find them, and run ./amkel.rb amkel.rb - this will create a single file which you can put somewhere in your $PATH. Which will make building stuff a whole lot easier.
Then put stuff in a structure like this:
/.../blah/image
/.../blah/resize
/.../blah/dither
And then you should be able to run amkel on 'resize.c' or on 'dither.c' and it will automatically include the image library and compile everything. If you haven't made the single-file version of amkel, then be aware that you will probably have to run amkel from inside its own directory.
Enjoy the source code party.