replace to layer.paint()
from image.paintBuffer