Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: BMP: Drawing or photograph?

by zentara (Archbishop)
on Oct 29, 2012 at 10:28 UTC ( [id://1001337]=note: print w/replies, xml ) Need Help??


in reply to BMP: Drawing or photograph?

PNG is better if there is written text, JPG is better for drawings and images. The best converter is ImageMagick.
# using the ImageMagick c program system( "convert my.bmp my png");
or using the Perl module, here is a generic conversion routine:
#!/usr/bin/perl use warnings; use strict; use Image::Magick; my $imgfile = shift; # your BMP file my $image = Image::Magick->new(); $image->Read($imgfile); my $blob = $image->ImageToBlob(); # make in memory image #and to convert my $output = Image::Magick->new(magick=>'jpg'); # set your output for +mat $output->BlobToImage( $blob ); $output->Resize(geometry=>'160x120'); $output->Write( "$0.jpg" ); #or if you want to write to stdout #binmode STDOUT; #$output->Write('jpg:-');

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2024-04-23 10:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found