Image Processing with Primitive

How It Works

Primitive is a machine-learning based program which converts images to its geometric primitives form (written in Go).

maid-primitive-gif

Initially, Maid-chan will validate whether the image input is either .png or .jpg.

Maid-chan creates 3 different images via Primitive. The shell command which is executed:

$ primitive -i /tmp/{input_file} -o /tmp/{primitive_output_file} -n 175 -v

Finally, ImageMagick converts those 3 generated images to a GIF file with:

$ convert -delay 1x5 -loop 0 /tmp/{primitive_output_files} /tmp/{gif_output_file}

Since primitive uses hill climbing and simulated annealing in image generation, the entire process might take several minutes depending on CPU capacity.

How to Run

  1. Ensure you have ImageMagick installed.
  2. Then, you can start running Maid-chan primitive worker by executing:
$ maidchan_primitive