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.
Polaroid Giving Black Background
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Polaroid Giving Black Background
You must enable (set) alpha channel before adding polariod transparency.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/