Forum: Ruby Blur on transparent images with RMagick

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
August L. (Guest)
on 2008-12-16 17:05
(Received via mailing list)
Hello,

Let's start with some code. http://pastie.org/340438 . If you run it
(after changing the font on line 33), you get a neat image with the
text appearing two times. One flat, the other with a blur.

Now, set the background_color to 'transparent' on line 30, and voila
-- no blur.

I'm running RMagick 2.8.0 and ImageMagick 6.4.4 2008-11-21 Q16. Anyone
knows what this is all about?
Tim H. (Guest)
on 2008-12-17 00:42
August L. wrote:
> Hello,
>
> Let's start with some code. http://pastie.org/340438 . If you run it
> (after changing the font on line 33), you get a neat image with the
> text appearing two times. One flat, the other with a blur.
>
> Now, set the background_color to 'transparent' on line 30, and voila
> -- no blur.
>
> I'm running RMagick 2.8.0 and ImageMagick 6.4.4 2008-11-21 Q16. Anyone
> knows what this is all about?

blur_image only blurs the RGB channels. Use this instead:

    @image = @image.blur_channel(0,3, Magick::AllChannels)

If you have any other questions about RMagick you can reach me at the
RMagick Help Forum on RubyForge
(http://rubyforge.org/forum/forum.php?forum_id=33) or directly at
rmagick AT rubyforge DOT org.
This topic is locked and can not be replied to.