Hi All, I am using Perl GD to generate some images. I am not quite happy with the image resolution and the color quality. Is there as way to improve one of it or both. Apologise for a basic question (new to this field). Can any one give any suggestions please. Thanks in advance Nagesh

Update

Thanks for all the messages and to jhourcle for a lenghty explanation. Sorry for not responding back due to the time difference. The essence of the code is to generate little triangles and rectangles on a given line dynamically based on the input file and hence I am not using any photos or images with gradient (hence I feel jpeg is not an option for me). These triangle are 3 pixel in the base and height. The problem I am having is that the slope of the triangle is not smooth (can this problem be related to my screen resolution? but did not have this problem before). Also the overall image does not appear to be sharp. The code runs into several hundered lines and I will put the relavant code. When I try to use true color, I get a black background. When I remove the truecolor parameter, I get a image with a white back ground (how is this influencing the image background). If there is a way to post the image, please let me know and I will do it as I am not sure if that the best quality one can get. Also note that using gif, png did not change the final image resolution. my GD package does not support tif. I feel the problem is related to inability to use true color as I tried to specify to use truecolor instead of palette based color but not successful.
use GD; $im = new GD::Image(1000,100,1); code to generate polygons (triangle) and rectangles print $im->png(0);
Thanks Nagesh

In reply to How to improve image resolution...Continued by chakkaln

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.