def write_out(path = nil)
      return img unless path
      FileUtils.mkdir_p File.dirname(path)
      img.write(path)
      path
    rescue Errno::ENOENT
      puts_and_exit("Path not found '#{path}'")
    end
def write_out(path = nil)
      return img unless path
      FileUtils.mkdir_p File.dirname(path)
      img.write(path)
      path
    rescue Errno::ENOENT
      puts_and_exit("Path not found '#{path}'")
    end
Writes image to disk