【问题标题】:How to interprete Tiff image spec 6.0 packbits compression如何解释 Tiff 图像规范 6.0 packbits 压缩
【发布时间】:2013-11-27 03:14:37
【问题描述】:

以下来自 TIFF 6.0 规范第 9 节:PackBits 压缩

这就是算法的本质。以下是一些附加规则:

  1. 单独包装每一行。不要跨行边界压缩。
  2. 每行未压缩字节数定义为 (ImageWidth + 7) / 8. 如果要求未压缩的位图每个字节数为偶数 行,解压缩成字对齐的缓冲区。
  3. 如果运行大于 128 字节,则将运行的剩余部分编码为一个或多个 额外的重复运行

第一项和第三项很容易理解,但我对第二项特别感到困惑:每行未压缩的字节数定义为 (ImageWidth + 7) / 8。这不仅适用于1 位双层图像。但据我所知,packbits 是一种面向字节的压缩算法,它可以用于任何类型的 tiff。

知道 tiff 和 packbits 的人能给我一些提示吗?

【问题讨论】:

    标签: image compression tiff


    【解决方案1】:

    来自该站点的 TIFF 文档:http://www.fileformat.info/format/tiff/corion-packbits.htm 顶部有以下内容:

          Abstract
    
          This document  describes a  simple compression scheme for bilevel
          scanned and paint type files.
    
    
          Motivation
    
          The TIFF  specification defines  a number of compression schemes.
          Compression type  1 is  really no  compression, other  than basic
          pixel  packing.     Compression   type  2,   based  on  CCITT  1D
          compression,  is   powerful,  but   not  trivial   to  implement.
          Compression type  5 is  typically very effective for most bilevel
          images, as  well as  many deeper images such as palette color and
          grayscale images, but is also not trivial to implement.  PackBits
          is a simple but often effective alternative
    

    所以很明显,附加规则是针对双层图像的。由于某种原因,TIFF6.0的pdf版本中缺少上述摘要和描述。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-22
      • 2013-08-07
      • 1970-01-01
      相关资源
      最近更新 更多