Page MenuHome

Added paste functionality to ImBuf
AbandonedPublic

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

Details

Summary

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 imbuf.new calls. (RGBA, RGB, L, for now).

import imbuf

dst = imbuf.new((256, 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