implemented the scaleToTexture8bits