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.
70ca58d0e0e0eabbdb74d177417d09d7?d=identicon&s=25 August Lilleaas (leethal)
on 2008-12-16 16: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?
B33ea5c12d767bfd1253940a960274f5?d=identicon&s=25 Tim Hunter (timhunter)
on 2008-12-16 23:42
August Lilleaas 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.