# File lib/mini_magick/image.rb, line 348 def get_pixels convert = MiniMagick::Tool::Convert.new convert << path convert.depth(8) convert << "RGB:-" # Do not use `convert.call` here. We need the whole binary (unstripped) output here. shell = MiniMagick::Shell.new output, * = shell.run(convert.command) pixels_array = output.unpack("C*") pixels = pixels_array.each_slice(3).each_slice(width).to_a # deallocate large intermediary objects output.clear pixels_array.clear pixels end