For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > October 2005 > Convert Post script to Jpeg/html/gif









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Convert Post script to Jpeg/html/gif
rajendra.bh@gmail.com

2005-10-05, 6:57 pm

Can you please help me with this. I have generated a Post script image
file using gnuplot on Unix platform and I want to display the image
file on the web in real-time. I want a perl utility that can convert
the postscript image file to html or jpeg or gif etc or any format that
can be displayed on the web.

Your help will be nuch appreciated.

Thanks in advance.
Raj

Robert Melson

2005-10-05, 6:57 pm

In article <1128543940.943499.15880@g49g2000cwa.googlegroups.com>,
rajendra.bh@gmail.com writes:
> Can you please help me with this. I have generated a Post script image
> file using gnuplot on Unix platform and I want to display the image
> file on the web in real-time. I want a perl utility that can convert
> the postscript image file to html or jpeg or gif etc or any format that
> can be displayed on the web.
>
> Your help will be nuch appreciated.
>
> Thanks in advance.
> Raj
>


Try ImageMagick, a public domain package for image manipulation. Has a neat
convert app that should do exactly what you want.

HTH,
Bob Melson


--
Robert G. Melson | Rio Grande MicroSolutions | El Paso, Texas
-----
"One of the greatest delusions in the world is the hope that the evils in this world are to be cured by legislation." Thomas Reed
-----

zentara

2005-10-06, 8:05 am

On 5 Oct 2005 13:25:40 -0700, rajendra.bh@gmail.com wrote:

>Can you please help me with this. I have generated a Post script image
>file using gnuplot on Unix platform and I want to display the image
>file on the web in real-time. I want a perl utility that can convert
>the postscript image file to html or jpeg or gif etc or any format that
>can be displayed on the web.
>
>Your help will be nuch appreciated.
>
>Thanks in advance.
>Raj


Here is a simple usage of ImageMagick

#!/usr/bin/perl
use warnings;
use strict;
use Image::Magick;

my @files = (<*.ps> );
my $newtype = 'jpg';

foreach my $infile(@files){
(my $filebase) = $infile =~ /(.*)\.(\w+)$/;
print "$filebase\n";

my $p = new Image::Magick;
$p->Read($infile);
$p->Write($filebase.'.'.$newtype);
#unlink $infile; #uncomment to delete the ps files
}



--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com