【发布时间】:2018-02-21 14:58:32
【问题描述】:
GM 有构建选项quantum,它定义了何时使用的位深度 读取图像。用高量子构建 GM 意味着 更小的位深度会占用更多的内存。
这里的量子是什么?谁能给我一些关于这方面的资源?
【问题讨论】:
标签: imagemagick graphicsmagick
GM 有构建选项quantum,它定义了何时使用的位深度 读取图像。用高量子构建 GM 意味着 更小的位深度会占用更多的内存。
这里的量子是什么?谁能给我一些关于这方面的资源?
【问题讨论】:
标签: imagemagick graphicsmagick
这是一个构建时设置,这意味着您需要重新编译 GraphicsMagick 才能更改它。
如果您使用Q8 构建,图像中的每个像素都可以有 2^8 个唯一值,即 256 种灰度。
如果您使用Q16 构建,每个像素可以有 2^16 个唯一值 - 即 65,536 种灰度。
因此,例如,使用较大的量子设置,从好的方面来说,您将获得更平滑的梯度,以及更少的舍入误差。缺点是您的处理可能需要更长的时间(取决于 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。
【讨论】:
根据this website,量子为:
GraphicsMagick 中用于表示颜色样本的基本类型是 量子型。像素由 Quantum 值的结构表示。 例如,一个 RGB 像素包含红色、绿色和蓝色量子, 而一个 RGBA 像素包含红色、绿色、蓝色和不透明量子。 Quantum 可以达到的最大值由一个常数指定 由 MaxRGB 定义表示的值,它本身由 Quantum 中的位数。 QuantumDepth 构建选项 确定 Quantum 中的位数。
【讨论】: