work directly on buffered image