Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Piece up a BMP file with Image::Magick

by rchiav (Deacon)
on Feb 07, 2002 at 17:55 UTC ( #143940=perlquestion: print w/replies, xml ) Need Help??

rchiav has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to discet an image file with Image::Magick and I'm running into some problems. I can get it to work, however, it's slow. The image(s) are 640x480 and I basically need to chunk it up into 40x40 squares. Reading the docs, the only thing I found that seemed to be useful is $image->Crop(). The only problem with that is, it alters the larger(original) image, as you would expect. The only way I saw around this was to reread the original image from disk over and over again. That's pretty slow.

Is there a way to load the original image once and then piece it up? I'm notall that familiar with image manipulation so I'm a little unsure of some of the methods mentioned.


Replies are listed 'Best First'.
Re: Piece up a BMP file with Image::Magick
by joealba (Hermit) on Feb 07, 2002 at 18:37 UTC
    Use the Clone method to make copies of the original.

    my $picture = Image::Magick->new(); $picture->ReadImage("$image_filename"); my $copy = $picture->Clone();

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://143940]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2021-07-26 01:48 GMT
Find Nodes?
    Voting Booth?

    No recent polls found