Search code examples
rubyherokurubygemsimagemagickrmagick

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.

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


Solution

  • 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.

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