Problem with image rotate RMagick

I cant seem to get an image rotate right.
I am using RMagick to do this.

the source image file is transparent with a single red line.

image = Magick::Image.read('public/images/line.png').first
image.rotate!(degrees.to_i)

the problem is that when i do this, every pixel that was transparent
becomes black.

The docs said that this would be the case, but i cannot seem to find
where to override this to preserve the transparency.

thanks for any tips.

sk

Shawn Bright wrote:

I cant seem to get an image rotate right.
I am using RMagick to do this.

the source image file is transparent with a single red line.

image = Magick::Image.read('public/images/line.png').first
image.rotate!(degrees.to_i)

the problem is that when i do this, every pixel that was transparent
becomes black.

The docs said that this would be the case, but i cannot seem to find
where to override this to preserve the transparency.

thanks for any tips.

sk

Try setting the image's background color to "none" before calling
rotate.

···

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

worked perfect,
thanks much

sk

···

On Feb 13, 2008 10:15 AM, Tim Hunter <rmagick@gmail.com> wrote:

Shawn Bright wrote:
> I cant seem to get an image rotate right.
> I am using RMagick to do this.
>
> the source image file is transparent with a single red line.
>
> image = Magick::Image.read('public/images/line.png').first
> image.rotate!(degrees.to_i)
>
> the problem is that when i do this, every pixel that was transparent
> becomes black.
>
> The docs said that this would be the case, but i cannot seem to find
> where to override this to preserve the transparency.
>
> thanks for any tips.
>
> sk

Try setting the image's background color to "none" before calling
rotate.

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