Create image with imagemagick without gem

i am trying to create image with imagemagick without any binding like rmagick or other gem just for rspec purpose and learning purpose. How can i do that please i have been stuck for more than 18 hrs .