Imagemagick 在GraphicsMagick中,量子是什么意思

Imagemagick 在GraphicsMagick中,量子是什么意思,imagemagick,graphicsmagick,Imagemagick,Graphicsmagick,GM有构建选项quantum,它定义了在 阅读图像。用高量子构建GM意味着 较小的位深度将占用更多的内存 这里的量子是什么?有人能给我一些关于这方面的资料吗?根据,quantum是: GraphicsMagick中用于表示颜色样本的基本类型是 量子类型。像素由量子值的结构表示。 例如,RGB像素包含红色、绿色和蓝色量子, 而RGBA像素包含红色、绿色、蓝色和不透明度量子。 量子能达到的最大值由一个常数指定 由MaxRGB define表示的值,其本身由 量子中的位数。QuantumDepth构建

GM有构建选项quantum,它定义了在 阅读图像。用高量子构建GM意味着 较小的位深度将占用更多的内存

这里的量子是什么?有人能给我一些关于这方面的资料吗?

根据,quantum是:

GraphicsMagick中用于表示颜色样本的基本类型是 量子类型。像素由量子值的结构表示。 例如,RGB像素包含红色、绿色和蓝色量子, 而RGBA像素包含红色、绿色、蓝色和不透明度量子。 量子能达到的最大值由一个常数指定 由MaxRGB define表示的值,其本身由 量子中的位数。QuantumDepth构建选项 确定量子中的位数


这是一个构建时设置,这意味着您需要重新编译GraphicsMagick,以便对其进行更改

如果使用
Q8
构建,图像中的每个像素可以有2^8个唯一值,即256个灰度

如果使用
Q16
构建,每个像素可以有2^16个唯一值,即65536个灰度

因此,使用较大的quantum设置,例如,在正的一面,您将获得更平滑的渐变和更少的舍入误差。缺点是,您的处理可能需要更长的时间(取决于CPU),并且需要更多的RAM来存储它

您可以通过以下方式检查当前设置:

gm identify version
样本输出

GraphicsMagick 1.3.27  Q16 http://www.GraphicsMagick.org/
Copyright (C) 2002-2017 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.

Feature Support:
  Native Thread Safe       yes
  Large Files (> 32 bit)   yes
  Large Memory (> 32 bit)  yes
  BZIP                     yes
  DPS                      no
  FlashPix                 no
  FreeType                 yes
  Ghostscript (Library)    no
  JBIG                     no
  JPEG-2000                no
  JPEG                     yes
  Little CMS               no
  Loadable Modules         yes
  OpenMP                   no
  PNG                      yes
  TIFF                     yes
  TRIO                     no
  UMEM                     no
  WebP                     no
  WMF                      no
  X11                      no
  XML                      yes
  ZLIB                     yes

Host type: x86_64-apple-darwin17.3.0

Configured using the command:
  ./configure  '--prefix=/usr/local/Cellar/graphicsmagick/1.3.27' '--disable-dependency-tracking' '--enable-shared' '--disable-static' '--with-modules' '--without-lzma' '--disable-openmp' '--with-quantum-depth=16' '--without-gslib' '--with-gs-font-dir=/usr/local/share/ghostscript/fonts' '--without-x' '--without-lcms2' 'CC=clang' 'CXX=clang++'

Final Build Parameters:
  CC       = clang
  CFLAGS   = -g -O2 -Wall -D_THREAD_SAFE
  CPPFLAGS = -I/usr/local/opt/freetype/include/freetype2 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2
  CXX      = clang++
  CXXFLAGS = -D_THREAD_SAFE
  LDFLAGS  = -L/usr/local/opt/freetype/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib
  LIBS     = -lfreetype -lbz2 -lz -lltdl -lm -lpthread
第一行中有
Q16
,这意味着我的量程是16