Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Point #1: PNG's limitation on image dimensions is 2**31 in both directions. So that makes the image max out at 2**31 * 2**31 (4_611_686_018_427_387_904). Take 8 bits for red, green, and blue color channels: 2**62 * 24 (Yes, it supports 12 bpp and one more channel, I know) Divide by 8 to get bytes: 13_835_058_055_282_163_712 That's 12 petabytes. I'd tell you what size a PNG of that raw image would be, but I can't do it on paper ;) The point is, larger than those dimensions, there is a loss, but I don't see anyone still using PNG by the time we can process that kind of data easily. (chunks are too small)

Point #2: JPEG also has a limitation on image dimensions, I'll leave it as an exercise to the reader. No more math, ugh.

Point #3: If I have a raw bitmap as described above, and feed it into a program (say raw2png), then feed it into png2raw, I will get the exact same bitmap. Lossless

Point #4: If I attempt to do the same with a JPEG converter, my images are different. JPEG estimates images using math. Lossy.

Point #5: If I am publishing an online comic, I'll use PNG. If I am publishing nature stock photos, I'll use JPEG. That's how it is. I'll do the same if I stick a small picture in a GUI.

Point #6: Why was my JPEG lossy? It was either me or my encoder because JPEG supports lossless compression -- must've been me.

Point #7: JPEG (DCT mode (normal mode, that is)) will always be lossier than PNG. It may have been made for natural images, but it's already ruined by being converted to digital representation. There is a great chance that analog images can be approximated using math, in fact, many mathematicians have analyzed this. If there were a way to store analog images on a "computer", then FFT it, then it would be still be lossy to an smaller extent, but PNG would be lossier :)

Okay, now that the points have been laid out, I will say this once and only once: Use the right tool for the job.

Another subject of concern is that my fellow monks, merlyn and sauoq, are at each-other's throats. There is a reason this is PerlMonks -- most monks are generally well-tempered and helpful. Try it.   I have reason to believe that neither of you did anything useful for the OP. Maybe one of you needs to be an adult and stop this, or maybe you both need to work it out in private. Whatever it is, get it out of useless threads in SoPW, please.
On-topic: I too attempted to use Tk::PNG and had issues on Win32... It's unlikely I have the expertise to sort all of the problems out; sorry.

mhoward - at -

In reply to Re: Re: GIF patent by meredith
in thread GIF patent by didier

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (7)
    As of 2021-01-18 10:58 GMT
    Find Nodes?
      Voting Booth?