Page 1 of 1

Polaroid Giving Black Background

Posted: 2010-12-04T15:46:58-07:00
by walzmyn
I'm trying to use the Polaroid function in conjunction with Montage. I am getting a black background behind the Polaroid and cannot seem to get rid of it.

Here's part of my code, (this is inside a loop).

my $a = (rand(10)-5);
my $rotate=Image::Magick->new;
$rotate->Read($pics[$_]) and warn ($ok);
$rotate->Polaroid(
angle=>$a,
stroke=>'red',
background=>'blue',
);
$rotate->Write($tmp);

I've also tried setting attributes on the $rotate before the Polaroid call, to set background color and basically every thing else I could find associated with color, same results. For the record, I don't need the red and blue colors above, I'm just showing what I've tried to get rid of the black.

In a related problem, once these images are made into Polaroids, I want to montage them. To get them into a single variable to make the montage I'm writing them out and reading them back into a new variable. I'm sure there's a better way. How do you move images from one perlmagick variable. Or, is there a way to work on individual images that are stacked into one variable.

Thanks in advance.

Re: Polaroid Giving Black Background

Posted: 2010-12-10T17:38:00-07:00
by anthony
You must enable (set) alpha channel before adding polariod transparency.