What do you mean by "easier"? If programming in individual pixel access, it's simplest to treat the image as a 2D array of pixels.

If using a library like ImageMagick, they are all equally easy because you use the same API.

"better with PNG" isn't just Perl, it's because libpng is promoted to go along with the png format, so any program can easily incorperate png support.

Choose PNG over GIF: well, there is a little problem with licencing fees. So you will find no (legal) free GIF software anymore, since nobody will pay $5000 to be allowed to code something which he'll then give away. PNG is better in every respect (by design) except as an animation format, so just use PNG and forget GIF.

If you just want to change a color globally, look into color-indexed modes rather than true color modes. Then you just change the value once, as the image data actually refer to the palette index.

Note that PNG allows for transparancy and alpha-blending, so maybe what you are really looking for are transparant sections?

—John


In reply to Re: Which graphics format can Perl alter easier and more? by John M. Dlugosz
in thread Which graphics format can Perl alter easier and more? by bladx

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.