使用默認的8位安裝Rmagick

[英]Install Rmagick with default 8 bits


By default Rmagick (based on ImageMagick) is built with a --with-quantum-depth=16 (16 bits per channel). This is not necessary for my application, and I fail to see how to install Rmagick/ImageMagick and make it use just 8 bits per channel.

默認情況下,Rmagick(基於ImageMagick)使用--with-quantum-depth = 16(每通道16位)構建。這對我的應用程序來說不是必需的,我沒有看到如何安裝Rmagick / ImageMagick並使其每個通道僅使用8位。

I am willing to install this on my local machine (Ubuntu 12.04) and Heroku using Gemfile.

我願意使用Gemfile在我的本地機器(Ubuntu 12.04)和Heroku上安裝它。

1 个解决方案

#1


1  

Quantum depth is defined at build time, but can be adjusted dynamically during run time. See -depth 8 option for ImageMagick, and self.depth = 8 in RMagick.

量子深度在構建時定義,但可以在運行時動態調整。請參閱ImageMagick的-depth 8選項,以及RMagick中的self.depth = 8。

img = Image.new(123,321) {
     self.depth = 8
}

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2014/01/08/d5ebcb4e51816c81a065697d7a1d8067.html



 
  © 2014-2022 ITdaan.com 联系我们: