Fixed transformation order to optimize with grayscale activated