rmagick-temp / rmagick

An interface to the ImageMagick and GraphicsMagick image processing libraries.
http://rmagick.rubyforge.org/
MIT License
790 stars 102 forks source link

Support "-alpha remove" to "flatten" the alpha channel #103

Open tstirrat opened 10 years ago

tstirrat commented 10 years ago

RMagick appears to support most of the options for img.alpha(type), but it doesn't support the alpha remove command.

from: http://www.imagemagick.org/Usage/masking/#remove

"The best solution is to use the Alpha Remove method to quickly and simply replace the transparency with a background color underlay..."

convert a.png   -background skyblue  -alpha remove -alpha off a_remove.jpg

At the moment I resort to a workaround:

img.border!(0, 0, 'white')
img.alpha Magick::DeactivateAlphaChannel