Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: BMP: Drawing or photograph?

by zentara (Archbishop)
on Oct 29, 2012 at 10:28 UTC ( #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


Comment on Re: BMP: Drawing or photograph?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (9)
As of 2015-07-05 04:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls