Thanks Tim for your reply.

My image is not with one solid color.
I have already an image to change the opacity.

Unfortunately, I tried
img.opacity = Magick::MaxRGB / 2
but it doesn't working

I tried also with background_color = 'none'.

Any clues?

Thanks

Tim Hunter wrote:
> Radu Ciocan wrote:
>> Hello,
>>
>> I use rmagick to create a new image.
>> How can I make this image with 50% transparency?
>>
>> Thanks
>>   
> If you just want a solid-color image that's 50% transparent, specify the
> color and transparency when you create the image:
> 
> img = Magick::Image.new(columns. rows) {self.background_color =
> Magick::Pixel.new(rr, gg, bb, Magick::MaxRGB/2)}
> 
> where columns and rows specify the size of the image, and rr, gg, bb
> specify the red, green, and blue channels.
> 
> If you have an image already and you want to change the opacity, use the
> #opacity attribute:
> 
> img.opacity = Magick::MaxRGB / 2
> 
> http://www.simplesystems.org/RMagick/doc/imageattrs.html#opacity
> http://www.simplesystems.org/RMagick/doc/struct.html#Pixel
> http://www.simplesystems.org/RMagick/doc/image1.html#new

-- 
Posted via http://www.ruby-forum.com/.