Click here to get back home

perl GD Image resolution problem

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
perl GD Image resolution problem Zhiliang Hu 05-05-2008
Posted by Zhiliang Hu on May 5, 2008, 11:28 pm
Please log in for more thread options
I use GD::Image to create figures. Here is an example:
http://sphinx.vet.unimelb.edu.au/QTLdb/tmp/map490151833.png

For publication purposes we need high resolution pictures. I am
seeking expert advice as how can I improve the resolution?

Thanks in advance!

Zhiliang

Posted by xhoster on May 5, 2008, 11:43 pm
Please log in for more thread options
> I use GD::Image to create figures. Here is an example:
> http://sphinx.vet.unimelb.edu.au/QTLdb/tmp/map490151833.png
>
> For publication purposes we need high resolution pictures. I am
> seeking expert advice as how can I improve the resolution?

Hi Zhiliang,

The resolution of a png is one pixel per pixel. You can't get any higher
than that! You should be able to make the entire image larger, for example
by specifying a larger array when you call new on your GD object.
Currently it is 360x402, you could try doubling each.

Or you may need to switch to something other than png, like svg using
GD::SVG.

Xho

--
-------------------- http://NewsReader.Com/ --------------------
The costs of publication of this article were defrayed in part by the
payment of page charges. This article must therefore be hereby marked
advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate
this fact.

Posted by zentara on May 6, 2008, 7:15 am
Please log in for more thread options
On Mon, 5 May 2008 20:28:15 -0700 (PDT), Zhiliang Hu

>I use GD::Image to create figures. Here is an example:
>http://sphinx.vet.unimelb.edu.au/QTLdb/tmp/map490151833.png
>
>For publication purposes we need high resolution pictures. I am
>seeking expert advice as how can I improve the resolution?
>
>Thanks in advance!
>
>Zhiliang

Use a camera with more mega-pixels, and set it to the highest
resolution. ( Usually the largest picture, allowing fewest pictures
in storage).

If you take a low resolution photo, and use a program to make it larger,
each pixel will be duplicated with the same color, to accomodate the
larger size. So the picture will be larger, but the resolution will not
improve.

Resolution comes from the camera's megapixel count and settings.

zentara

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

Posted by Zhiliang Hu on May 6, 2008, 11:29 am
Please log in for more thread options
Many thanks for all your hints. That'll be useful.

--
Zhiliang

Posted by zentara on May 7, 2008, 9:22 am
Please log in for more thread options
On Tue, 6 May 2008 08:29:09 -0700 (PDT), Zhiliang Hu

>Many thanks for all your hints. That'll be useful.

I just looked at your sample output, and since it's lines and
text, you could use the Scalable Vector Graphics format, or
.svg

GD has svg output with the module
http://search.cpan.org/~twh/GD-SVG-0.28/SVG.pm

SVG files look like xml, and will change resolution
automatically to adjust to window size.

Google for svg for more info.

zentara


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

Similar ThreadsPosted
Image::Magick and perl script STDOUT problem July 20, 2005, 10:05 am
GD.pm problem with GD::Image::newFromGif December 19, 2005, 1:50 am
Problem with Image::Info April 28, 2007, 4:07 pm
Image::Magick problem after (failed?) install August 19, 2004, 5:16 pm
how to simply parse raw image data and output to an image file ? January 3, 2008, 11:19 am
best way to store binary image data in a variable using image magick January 25, 2008, 1:17 am
to know resolution June 1, 2006, 9:26 am
Namespace resolution question: I'm somewhat puzzled April 7, 2006, 1:33 pm
Image processing in perl? September 13, 2007, 11:03 pm
perl PNG image searching May 6, 2008, 2:02 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap