module ChunkyPNG::Canvas::Operations
def crop(x, y, crop_width, crop_height)
def crop(x, y, crop_width, crop_height) new_pixels = [] for cy in 0...crop_height do new_pixels += pixels.slice((cy + y) * width + x, crop_width) end ChunkyPNG::Canvas.new(crop_width, crop_height, new_pixels) end