ruby-libgd

GD::Image#clone

Creates a deep copy of the image.

img2 = img.clone