Hello. I'm sorry if this has been answered elsewhere, but I've haven't had any luck finding a solution.
I'm trying to enlarge the canvas of an existing image. It seems that Crop will reduce the canvas, but not enlarge it, even with judicious use of exclamation marks. I don't want to scale the image itself, just the canvas or page size. Along the lines of Photoshop's "Canvas Size" feature.
More specifically, I'm trying to "embolden" an image by compositing it with itself, offset one pixel. This part works:
my $image = Image::Magick->new;
$image->Read($fn);
my $image2 = $image->Clone;
$image->Composite(compose => 'Darken', x => 1, y => 0, image => $image2);
But I'd like to add one pixel to the width of $image so that the final column is duplicated.
Thanks in advance!
Max
Enlarging the canvas
-
- Posts: 3
- Joined: 2007-12-17T02:22:32-07:00
Re: Enlarging the canvas
I agree. Unfortunately, $image->Extent gives me:RetroJ wrote:You want Extent.
[error] Can't locate auto/Image/Magick/Extent.al in @INC (@INC contains: /home/max /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl /usr/local/lib/perl/5.8.3 /usr/local/share/perl/5.8.3 /usr/local/lib/perl/5.8.0 /usr/local/share/perl/5.8.0 . /etc/apache/ /etc/apache/lib/perl) at Item2.pm line 3642
Is it something I need to install separately?
Thanks for your response.
Re: Enlarging the canvas
I can only guess that you are running an old PerlMagick.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Enlarging the canvas
You could try using splice with appropriate gravity options to add the one pixel column and row. It is a older function than extent.
Before that function the best method would be to append a single pixel image to the existing image.
Sorry I do not use PerlMagick often enough to know the function calls without looking them up myself.
Before that function the best method would be to append a single pixel image to the existing image.
Sorry I do not use PerlMagick often enough to know the function calls without looking them up myself.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/