optimized rescale_background plugin