Sunday 11 November 2012

Image Optimization and Storage

Image Optimization and Storage

Image optimization is when you compress the image to the most compressed but visually acceptable image for saving memory. Image optimization is also referred to as 'the power of two'. The power of two is when the width and height of an image is at the same value (e.g. 256,256 or 512,512), when applying a texture to a 3D model, the power of two rule is a must use. Ever worked with applying your own textures to 3D models only to find out the texture doesn't display correctly on the model? Chances are you didn't use the power of two rule. You have to use the power of two rule because if the width and height of a texture aren't the same and you applied the texture to the model then the result would be the texture wont be on it properly. Parts of the texture would be missing and it wouldn't fully cover the model.

A brick wall texture. This has been optimized to the size of 256 x 256

When a the size of a texture is stretched to fit a model by the program this is called interpolation. When interpolation is taking place with applying the texture to a bigger model it interprets how the image would look if it were bigger and by doing so, it would add whatever different colours it can from the image to fill the blank parts of the model. Of course if a texture is too small for an object/model, then the result would be the texture would appear very pixelated or blurred on the model. And textures of bigger sizes would use up more space on the hard drive. This is why we optimize the images using the power of two rule so we can save space as well as the information being processed on the computer faster meaning the program wont slow down when applying the optimized texture.

Another thing to consider would be the file type of the image. A JPEG file is known as a 'lossy' in this term because when an image file is being converted to a JPEG, some data is lost in the process and when the size is smaller, the optimization also decreased. A better alternative would be to use a PNG format image file. A PNG is known as a 'lossless' file because when an image file is converted to a PNG, no data is lost. And as no data is lost during compression, this makes it a much better file for optimization and a better format for a texture rather than a JPEG.

Taken from Wikipedia: A comparison of the differences between JPEG and PNG

No comments:

Post a Comment