分享维基的：图片文件数据结构，非常详细。

bmp file format
jpg file format
png file format

n位2n种颜色的包含调色板的位图近似字节数可以用下面的公式计算：

BMP文件大小 $\approx 54+4 \cdot 2^n+\frac{{\rm width} \cdot {\rm height} \cdot n}{8}$，其中高度(height)和宽度(width)都以像素为单位。

BMP文件大小 $\approx 54+\frac{{\rm width} \cdot {\rm height} \cdot n}{8}$，其中高度(height)和宽度(width)都以像素为单位。

Bitmap数据结构示例：以下示例：为2*2大小（宽：2，高：2）的24位深（位深：每个点（像素）使用多少字节存：1个字节即8位，24位即：24/8=3个字节）bmp位图文件信息。

Bitmap Data Example

I've been trying to add an example of the bitmap data, but it seems my efforts are not appreciated. What exactly is wrong with what I added? It is meant to be the pixel data after the 54 byte in the bitmap file. Dicklyon, I'd appreciate a more constructive comment than "this is wrong". While the text in the paragraph is somewhat clear, it doesn't go into detail about how the bits are stored in the file (i.e. what comes first blue, red, or green). I thought this example would be useful for someone who is writing a program that reads a bit map, which is what I've been doing.

Example of a 2x2 Pixel Bitmap, with 24 bits/pixel encoding
Bitmap Data Example using a 2x2 Pixel, 24-Bit Bitmap
Offset Size Hex Value Value Description
0 2 42 4D "BM" Magic Number (unsigned integer 66, 77)
2 4 46 00 00 00 70 Bytes Size of Bitmap
6 2 00 00 Unused Application Specific
8 2 00 00 Unused Application Specific
10 4 36 00 00 00 54 bytes The offset where the bitmap data (pixels) can be found.
14 4 28 00 00 00 40 bytes The number of bytes in the header (from this point).
18 4 02 00 00 00 2 pixels The width of the bitmap in pixels
22 4 02 00 00 00 2 pixels The height of the bitmap in pixels
26 2 01 00 1 plane Number of color planes being used.
28 2 18 00 00 00 24 bits The number of bits/pixel.
30 4 00 00 00 00 0 BI_RGB, No compression used
34 4 16 00 00 00 16 bytes The size of the raw BMP data (after this header)
38 4 13 0B 00 00 2,835 pixels/meter The horizontal resolution of the image
42 4 13 0B 00 00 2,835 pixels/meter The vertical resolution of the image
46 4 00 00 00 00 0 colors Number of colors in the pallet
50 4 00 00 00 00 0 important colors Means all colors are important
Start of Bitmap Data
54 3 00 00 FF 16,711,680 Red, Pixel (0,1)
57 3 FF FF FF 16,777,215 White, Pixel (1,1)
60 2 00 00 0 Padding for 8 bytes/row (Could be a value other than zero)
62 3 FF 00 00 255 Blue, Pixel (0,0)
65 3 00 FF 00 65,280 Green, Pixel (1,0)
68 2 00 00 0 Padding for 8 bytes/row (Could be a value other than zero)

维基百科上的算法和数据结构链接很强大

2014-04-21 13:30:50

数据结构--顺序表的建议和删除

2018-05-30 21:58:49

Android Intent分享文件|分享图片|分享文字|功能的实现

2015-09-19 21:46:48

通过改hosts访问wikipedia

2017-07-20 15:35:42

Wiki引用格式调整

2007-01-19 17:06:00

网页制作实践步骤一 导航栏

2015-07-31 11:51:25

ios Instagram 分享

2016-05-17 16:25:15

将图片和文件分享到自己的app中来

2016-09-20 15:37:57

Wiki基础知识

2007-10-11 18:31:00

UIDocumentInteractionController之程序间文档共享

2016-10-27 15:41:57