Image:replacePixels
Replace the contents of an Image.
Image:replacePixels( data, slice, mipmap, x, y, reloadmipmaps )
data ImageData The new ImageData to replace the contents with.
slice (1) number Which cubemap face, array index, or volume layer to replace, if applicable.
mipmap (1) number The mimap level to replace, if the Image has mipmaps.
x (0) number The x-offset in pixels from the top-left of the image to replace. The given ImageData's width plus this value must not be greater than the pixel width of the Image's specified mipmap level.
y (0) number The y-offset in pixels from the top-left of the image to replace. The given ImageData's height plus this value must not be greater than the pixel height of the Image's specified mipmap level.
reloadmipmaps (false) boolean Whether to generate new mipmaps after replacing the Image's pixels. True by default if the Image was created with automatically generated mipmaps, false by default otherwise.