Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Piece up a BMP file with Image::Magick

by rchiav (Deacon)
on Feb 07, 2002 at 17:55 UTC ( [id://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.

Thanks,
Rich

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (2)
As of 2025-01-23 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (67 votes). Check out past polls.