#include #include #include "images/images.h" int main(int argc, char* argv[]) { Image img; image_new(512,512, &img); Color* green = color_new(0,255,0); Color* purple = color_new(125,17,249); image_draw_rect(&img, 255, 0, 512, 255, green); image_draw_rect(&img, 0, 255, 255, 512, purple); for (int i = 0; i < 255; i++) { for (int j = 0; j < 255; j++) { image_set_px(&img, i, j, i, 0, 0); } } for (int i = 0; i <= 256; i++) { for (int j = 0; j <= 256; j++) { image_set_px(&img, i + 255, j + 255, j, j, 255); } } printf("Writing file to /home/anton/projects/mona/chaos/test.bmp\n"); if (!image_save(&img, "/home/anton/projects/mona/chaos/test.bmp")) { printf("Error writing file!\n"); } else { printf("Wrote file successfully\n"); } image_destroy(&img); free(green); free(purple); }