Page MenuHome

Added paste functionality to ImBuf

Authored by Colin Basnett (cmbasnett) on Mon, Nov 4, 12:56 AM.



This adds paste functionality to ImBuf, allowing you to paste an image inside another image.

Incidentally, this also adds functionality for the user to specify the color type on calls. (RGBA, RGB, L, for now).

import imbuf

dst =, 256))
src = imbuf.load('src.png')

x = 0
y = 0
box = (0 + x, 0 + y, src.size[0] + x, src.size[1] + y)

dst.paste(src, box)

imbuf.write(dst, 'dst.png')

Diff Detail