D
dc
hi -
(this maybe more an imagemagick q that a ruby one, but here goes ..)
using rmagick / I have a small script for generating some type, but I
cannot get the type to come out as transparent png - it comes out just
on solid white .
does this have to be done with masks and compositing? there are a
number of methods that look like they should work (transparent_color
etc), but dont seem to...
is the library broken or am i doing something wrong?
tx,
/dc
---------
require 'rubygems'
require "RMagick"
include Magick
outfile = "output/matte.png"
drawObj = Magick:raw.new
drawObj.font = './fonts/Ghoul.ttf'
drawObj.pointsize=30
drawObj.fill = '#44ff00'
buffer = Magick::Image.new(250,100)
drawObj.text(20,50, "hello world")
drawObj.matte(3,3,PaintMethod::ReplaceMethod)
drawObj.draw(buffer)
buffer.opacity = 1
buffer.transparent_color = '#000000'
buffer.matte = true
buffer.write(outfile)
system("open #{outfile}")
--
(this maybe more an imagemagick q that a ruby one, but here goes ..)
using rmagick / I have a small script for generating some type, but I
cannot get the type to come out as transparent png - it comes out just
on solid white .
does this have to be done with masks and compositing? there are a
number of methods that look like they should work (transparent_color
etc), but dont seem to...
is the library broken or am i doing something wrong?
tx,
/dc
---------
require 'rubygems'
require "RMagick"
include Magick
outfile = "output/matte.png"
drawObj = Magick:raw.new
drawObj.font = './fonts/Ghoul.ttf'
drawObj.pointsize=30
drawObj.fill = '#44ff00'
buffer = Magick::Image.new(250,100)
drawObj.text(20,50, "hello world")
drawObj.matte(3,3,PaintMethod::ReplaceMethod)
drawObj.draw(buffer)
buffer.opacity = 1
buffer.transparent_color = '#000000'
buffer.matte = true
buffer.write(outfile)
system("open #{outfile}")
--