Wednesday 30 January 2013

Image Size (Padding & color table)

Simply,we think that the pixel array size is only depends upon image width & image height but there is an issue in this that a row size will be always multiple of four it means if width of image is not in multiple of 4   .Then the row size will be made to multiple of 4.we can check it through taking any image. For example,
If there is 24-bit image of image width 800 & image height 1274 .Then there is no need of padding because the image width is in multiple of 4 bytes.But if we take an image of 24-bit with image width 1274 & image height 800. We need padding of two bytes in each row So image size increased with 800*2*=1600 bytes.Thus if we have a 24-bit image with image width 1274 & image height 1274 then we need same amount of padding because the padding is only needed for the width.The same theory is applied to the 8-bit image but there is a color table added to the image which has a size of 1024 bytes.

No comments:

Post a Comment