Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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 romping around the Monastery: (8)
As of 2014-08-22 11:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (156 votes), past polls