--- /dev/null
+/*
+ * unable to use gimp?
+ * me too!
+ *
+ */
+
+#include <stdio.h>
+#include "bmp.h"
+
+int main(int argc,char **argv) {
+
+ t_bmp bmp;
+ int i,j;
+ char val;
+ int off;
+
+ bmp_init(&bmp,2);
+
+ bmp.width=40;
+ bmp.height=120;
+ bmp.mode=WRITE;
+ if(argv[1][0]=='c') strcpy(bmp.file,"c-col.bmp");
+ else strcpy(bmp.file,"p-col.bmp");
+
+ bmp_alloc_map(&bmp);
+
+ for(i=0;i<bmp.height;i++) {
+ if(argv[1][0]=='c') {
+ for(j=0;j<bmp.width;j++) {
+ off=i*bmp.width+j;
+ val=i*255/bmp.height;
+ bmp.map[off].r=val;
+ bmp.map[off].g=val;
+ bmp.map[off].b=0xff;
+ }
+ } else {
+ for(j=0;j<bmp.width;j++) {
+ off=i*bmp.width+j;
+ if(i<bmp.height/2) {
+ val=i*255/(bmp.height/2);
+ bmp.map[off].b=val;
+ bmp.map[off].g=0;
+ bmp.map[off].g=0;
+ } else {
+ val=(i-bmp.height/2)*255/(bmp.height/2);
+ bmp.map[off].b=0xff;
+ bmp.map[off].g=val;
+ bmp.map[off].b=0;
+ }
+ }
+
+ }
+ }
+
+ bmp_write_file(&bmp);
+
+ bmp_shutdown(&bmp);
+
+ return 1;
+}