Here’s some code to overlay a transparent square over a blue background
- at least I think it should do this.
I’m on OSX 10.7.3, ruby 1.9.3p125, RMagick 2.13.1, ImageMagick 6.7.5-7
Code:
###########################
require ‘RMagick’
bg = Magick::Image.new(400, 400) {
self.background_color = ‘blue’
}
sq = Magick::Image.new(200, 200) {
self.background_color = ‘none’
}
bg.composite!(sq, 0, 0, Magick::OverCompositeOp)
bg.write(‘out.png’)
###########################
Here’s my output (The square is not transparent, it’s completely black):
http://i.imgur.com/TKVHr.png
Does this happen to you? Any idea what’s going on?