There might be differences in the interpolation results between PIL's implementation and the native one (I haven’t checked it recently). To make sure the same algorithm is used, you could stick to one library for both, the input and mask.