標題:

aa.jpg

 

此文章來自奇摩知識+如有不便請留言告知

圖片計算方式

發問:

1.一張512 * 512 的黑白照片,需要0.25MB,該照片之灰階值有幾個? 答案是 256 2.一張灰階值256之1024*1024的黑白照片,在不壓縮的情況下,需要幾MB? 答案是 1 請列計算過程 謝謝大大~ (這是醫資考古題,不是作業)

最佳解答:

correctly calculate : width_bytes = fetch qotient ((width x pixel +31) /32) x 4 ; total = width_bytes * height; 1. because reverse calculation, You can ingnore 31 width * pixel / 8 * height = 2 ^9 * pixel / 8 * 2 ^9 = 0.25 * 2 ^20; pixel = 8; every pixel occupies 8 bit, so gray level = 2 ^ 8 = 256 2. because every pixel occupies 8 bit, width_bytes = fetch qotient (1024 * 8 + 31)/8 = 1024 = 2 ^10 total = with_bytes * height = 2^10 * 2^10 = 2^20 = 1MB note: width * height * ( pixel /8 ) is wrong, because memory boundary must be 4 multiple. such as: resolution 642 * 480 24bit colors width_bytes = fetch qotient (( 642 x 24) + 31)/32 = 482 = 482 x 4 total = 482 x 4 x 480 = 925440 bytes if use 642 x 480 x (24/8)= 924480 bytes , the method is error. 2013-11-28 18:15:39 補充: sorry ! 2. width_bytes = fetch qotient (1024 * 8 + 31)/32 * 4 = = 256 * 4 = 1024 = 2^10 total = width_bytes * height = 2^10 * 2^10 = 2^20 = 1Mbytes

其他解答:

還是要去 http://aaashops。com 品質不錯,老婆很喜歡。 凎佫吥凂倲劕8081B933AEEFE995
arrow
arrow

    dlxpxv7 發表在 痞客邦 留言(0) 人氣()