我知道使用 imageinterlace
可以创建渐进的图像,但我需要知道是否可以实际要求渐进的特定步骤。假设如果 Jpeg 文件是使用 3 级扫描创建的,我是否可以将其降级为仅 2 级或 1 级?
最佳答案
在构建 JPEG 时,这似乎不是您可以实际控制的事情。
来自Wikipedia's article on JPEG :
Baseline JPEG also supports progressive encoding. While sequential encoding encodes coefficients of a single block at a time (in a zigzag manner), progressive encoding encodes similar-positioned coefficients of all blocks in one go, followed by the next positioned coefficients of all blocks, and so on. So, if the image is divided into N 8×8 blocks {B0,B1,B2, ..., Bn-1}, then progressive encoding encodes Bi(0,0) for all blocks, i.e., for all i = 0, 1, 2, ..., N-1. This is followed by encoding Bi(0,1) coefficient of all blocks, followed by Bi(1,0)-th coefficient of all blocks, then Bi(2,0)-th coefficient of all blocks, and so on. It should be noted here that once all similar-positioned coefficients have been encoded, the next position to be encoded is the one occurring next in the zigzag traversal as indicated in the figure above.
根据描述,无法实际控制 JPEG 隔行扫描的性质。通过次数是标准和图像格式本身的一部分。
most other image formats 中同样无法控制。 ,其中大多数在其标准中也明确指出了一种且仅有一种交错公式,但 TGA 除外,它有两种。
关于php - GD 可以选择渐进式 JPEG 中的隔行扫描深度吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13890468/