Skip to main content

Draw an image onto another (:draw_image)

Declaration

big = big:draw_image(small[, {
left = left_x,
top = top_y,
alpha = alpha,
background = {
{color*, tolerance*},
{color*, tolerance*},
...
},
}])

Parameters

  • small
    Image object. The image to draw on big image
  • left
    Integer, optional. Left-top x of where to draw the small image on big. Default 0
  • top
    Integer, optional. Left-top y. Default 0
  • alpha
    Integer, optional. Opacity of small image, 0~255. Default 255
  • color*, tolerance*
    Array, optional. Colors on small image whose color difference within tolerance* will be ignored (not drawn). Default: draw all colors

Returns

  • big
    Image object. Returns the big image itself

Description

Draw an image onto another image
Mutates the image in-place
Performance: no data copy during operation