Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!


Forgot your password?
Graphics Software Patents

GIF Support Returns to GD 364

g_adams27 writes "Legions of geeks and developers owe a debt of gratitude to Tom Boutell and his "gd" library, which powers the drawing and graphic-generating tools used by dozens of open-source projects. And now, with the expiration of the last Unisys patent on the GIF format, support for GIFs has finally been reinserted in gd. The GIF/PNG/MNG wars may continue, but having more options is good!"
This discussion has been archived. No new comments can be posted.

GIF Support Returns to GD

Comments Filter:
  • Nice GD Info (Score:5, Informative)

    by mfh ( 56 ) on Thursday July 22, 2004 @01:39PM (#9771423) Homepage Journal
    I'm not sure if the PHP guys saw this coming or not, but gd_info() [php.net] (PHP 4 >= 4.3.0, PHP 5) will detect GIF support, so you can tell if you've got the thing set up correctly with a nice little one-liner:


    Some nice soul posted a comment on PHP.net that has what appears to be a great function that does the same thing, but could be used in install scripts and hacked to get it working the way you want:
    * Get which version of GD is installed, if any.
    * Returns the version (1 or 2) of the GD extension.
    function gdVersion() {
    if (! extension_loaded('gd')) { return; }
    $info=stristr($info, 'gd version');
    preg_match('/\d/', $info, $gd);
    return $gd[0];
    } // end function gdVersion()

    // The function is easy to use.

    if ($gdv = gdVersion()) {
    if ($gdv >=2) {
    echo 'imageCreateTruecolor() and imageCopyResampled() functions may be used.';
    } else {
    echo 'imageCreate() and imageCopyResized() functions must be used.';
    } else {
    echo "The GD extension isn't loaded.";
    • by mfh ( 56 )
      It would be nice to have this story filed under PHP as a subtopic, authors!
      • Re:PHP (Score:3, Informative)

        by Greedo ( 304385 )
        PHP isn't the only thing to use GD, although I'm guessing it's the most popular one.
        • Re:PHP (Score:3, Insightful)

          by scottj ( 7200 )
          PHP is definitely not the only user of GD. Heck, GD is a C library. There are a lot of C apps out there that use it.

          Personally, I've only used GD via perl and the many perl libraries that use it, primarily GD.pm [cpan.org].
    • Re:Nice GD Info (Score:3, Informative)

      by Greedo ( 304385 )
      PHP has always support GIF reading. They took the GIF writing support out when Unisys were being dinks.
  • by Neil Blender ( 555885 ) <neilblender@gmail.com> on Thursday July 22, 2004 @01:40PM (#9771436)
    I know I didn't.
    • Only those people with no respect for intellectual property rights kept using them.

      I find it interestingly ironic that most commercial software disrespected IP-rights by continuing to include GIFs, while the open source community showed far more respect for intellectual property law by going through great effort to avoid violating such patents.

      • Or... commercial software paid the royalties to create GIFs, just as they pay royalties to use other technologies.

        There really isn't a lot of software out there which needs to create gifs.

      • They disrespected intellectual property laws by paying license fees to Unisys?

      • The big dawgs bought licenses bro.

      • Gee, or maybe the big commercial companies actually PAID for a license to use it?

        Use your brain, it's there for a reason :P
      • Wrong (Score:5, Insightful)

        by adiposity ( 684943 ) on Thursday July 22, 2004 @03:30PM (#9772611)
        Unless you know the business internals and license agreements of those companies, you have no idea whether they respected the patents or not. However, all major graphics program vendors (Adobe, JASC, etc.) have LICENSED the gif compression algorithm, and used it in their programs. Those who paid to use those programs have the right to create gifs.

        These commercial softwares did not disrespect "IP-rights," they meticulously followed the law by doing exactly what's required to use the patented algorithm. They showed respect for the patent by paying to use the algorithm. Free software respected the same rights by not using what they hadn't paid to use (because they either couldn't or weren't willing to).

        • Re:Wrong (Score:3, Insightful)

          by scottj ( 7200 )
          EXACTLY! My photoshop-created GIFs were not disrespecting any patents or laws. They were fully and completely licensed. That fact that the license for the GIF code wasn't free didn't make it any less legal. It was merely commercial software.

          But now that it's returning to the public domain finally, I have found that I prefer PNG and its alpha transparency to GIFs. It seems that Unisys' actions provided an incentive to innovate rather than stifling creation.
    • As an occasional graphics developer/creator, I chose not to create graphics in the GIF format.

      As a web browser user I did not choose to block GIF files, disable display of them, or attempt to contact the webmasters of sites that did choose to create and distribute GIF files to see if they held a licence from Unisys, or if the graphics creation tools they were published by developers who were paying royalties to Unisys.

      Did you?

    • Yes, I also used GIF if there was a doubt PNG wouldn't be supported in the application the graphics was aimed for. As for all internet graphics, I switched to PNG there, and only used GIF if the image had to be transparent due to IE's infamous PNG transparency bug.

      Actually, IE doesn't even seem to support the "GIF style" transparency (i.e. not alpha channels) for PNG images, where you set a color to act as the transparent color. It looks like it works correctly until you notice there's often a slight light
  • Unisys (Score:2, Insightful)

    by Anonymous Coward
    I bet nobody in Unisys (at least nobody high up) even knew about this happening ... otherwise they would have realized they weren't making money in the last year and put it in the public domain and made a press release etc.

    Shows you that a corporation like Unisys isn't dynamic. RSA on the other hand, was making money off their patent and decided that there's value in releasing it into the public domain prior to the patent expiration date.

    • While it's possible you are correct, it seems also at least as feasible that they were making money from licenses. In that case, they'd have ha dto give up the revenues from the final year or two, or face legal action by licensees. Regarless of the merits of such cases, it probably would have cost more to fight the battles than they made from licenses. Since they were off most peoples' radar screens, they simply chose to keep the status quo. After all, it was making money!

  • by Anonymous Coward on Thursday July 22, 2004 @01:43PM (#9771461)
    Beware of Geeks bare in GIF's.
  • by wheany ( 460585 ) <wheany+sd@iki.fi> on Thursday July 22, 2004 @01:44PM (#9771471) Homepage Journal
    The only thing gif does better than png is animation. Okay, on some rare occasions, gif compresses better. But most of the time, you have no reason to use gif instead of png.
    • Beta was and is better than VHS. Anyone understanding video would choose Beta over VHS. Millions of average people began buying VHS machines because they were cheap. Millions more began buying VHS machines because they would play other people's tapes. Beta, the superior technology, lost to the cheaper, "good enough" VHS because of market adoption. Internet Explorer has and will always have GIF support. Its PNG support is less than optimal. Got something you want everyong to see? Use GIF.
      • Beta had one crippling limitation, it's play length, Betamax was limited to 60 minutes where VHS allowed for 120 minutes, and could use a technique to make the video look worse but allow for a 4 hour playtime, which any movie could fit into, you wouldn't want to flip over your DVD in the middle of the movie, neither did people want to swap another tape into their Betamax machines

        Betamax did dominate the broadcast market where there are still many being used today. Sort of akin to DAT being used in professi
    • Backwards compatibility. Ever view a site that uses PNG on a 4.X generation browser?
    • Perhaps for applications software or an internal web application, yes.

      But most of the time, you have no reason to use gif instead of png.

      Most of the time, I need transparency in IE.

      • IE supports 256color PNG files with a single palette transparency with no JS or special crap like is required to support the 32bit PNG's alpha channel.
        The PNG is usually smaller too.
        Unless you need animation, PNG is just better.
  • by AKAImBatman ( 238306 ) <akaimbatman&gmail,com> on Thursday July 22, 2004 @01:44PM (#9771477) Homepage Journal
    GIFs are great for animations, but I really do prefer PNGs at this point. While it really isn't that big of a deal, PNGs are simply smaller and look better. If we could just get Microsoft to fix Internet Explorer, we'd have a new defacto standard for all non-photographic images.
  • That's cool info. Maybe the excellent GDChart [fred.net] Tool can now be upgraded to use the latest GD library..

    It used to rely on a very old gd lib for gif support.

  • What format war? (Score:2, Insightful)

    Can you show me a mainstream, modern browser that doesn't understand both GIF and PNG?
    • Re:What format war? (Score:5, Informative)

      by wkitchen ( 581276 ) on Thursday July 22, 2004 @01:55PM (#9771595)
      Not complete lack of support, but IE's PNG support is partly broken. Mostly in that it doesn't support alpha transparency, though all other major browsers do. And that's a real shame because it's a very nice feature. This alone would give PNG a clear advantage over GIF if it wasn't for the fact that the only major browser that doesn't support it happens to account for over 90% of the user base.
      • the only major browser that doesn't support it happens to account for over 90% of the user base.

        I'd just like to take this opportunity to point out that IE5 and IE6 together account for just over 80% of the market. (http://www.w3schools.com/browsers/browsers_stats. asp) They're slipping!

      • Here's a suggestion to change this.

        First, we need a way to make people view web pages in a PNG-compliant browser. Seems to me that the "best viewed at..." lines always seemed to get the public attention toward a specific browser. It worked quite well for IE. People perceived the line as meaning that those web pages used advanced features that only worked in the shiny, new Internet Explorer.

        However, now the tables have actually turned. IE is no longer the shiny and new browser. It's getting dated. It
  • by IGnatius T Foobar ( 4328 ) on Thursday July 22, 2004 @01:47PM (#9771513) Homepage Journal
    The usual crowd of nincompoop Slashbots are going to crow "They should just leave it out! Everyone should use PNG anyway!!"

    Let me answer that in advance by reminding everyone that GIF is a useful format. Everything can read it and display it. It's been around for two decades and is now a completely open and unencumbered standard.

    And let's not forget that when you need to display an image that is non-lossy, and supports transparency, and displays properly in Internet Explorer (shame on you for using Internet Explorer in the first place, but we'll accept that a lot of people still do) ... GIF is still the only available option.
    • by Anonymous Coward
      when you need to display an image that is non-lossy, and supports transparency, and displays properly in Internet Explorer

      We'll ignore the fact that GIF is limited to 256 color non-lossyness, but which of those does 8-bit PNG not meet? It's just as non-lossy as GIF, it supports single bit transparency (just like GIF), and it displays properly in IE. Now, IE has trouble with 24bit color PNG with transparency, but that's not something GIF is capable of.
    • Umm, no. PNG may not be properly supported in IE (although, I believe it is in the Mac version of IE for some reason), but all of the features of GIF (minus animation) are supported by PNG in IE (i.e. 1-bit transparency).
    • Ancient software? (Score:4, Informative)

      by Inominate ( 412637 ) on Thursday July 22, 2004 @02:00PM (#9771654)
      Any browser which doesn't support PNG is also not going to deal well with the rest of basicly all websites, or anything else on the modern internet.

      IE displays PNG's properly, with transparency, and it's still non-lossy. IE only doesnt properly support the alpha channel of PNG's.
    • The usual crowd of nincompoop Slashbots are going to crow "They should just leave it out! Everyone should use PNG anyway!!"
      It might be more effective to wait until somebody tries to make the point you're arguing against. As things stand you are only arguing with yourself.
  • Are we sure M$ doesn't have some patent now that could cause some trouble on this. At their rate of getting patents on technology/already-dev-tech they will have a patent on everything.
  • Could anyone on the know tell the rest of us why is it that digital cameras choose JPG as the compressed format instead of PNG ? Looks to me like PNG would typically provide better image resolution for a similar filesize. Maybe I am wrong. And also, is GIF an option now that it is free again ?
    • Could anyone on the know tell the rest of us why is it that digital cameras choose JPG as the compressed format instead of PNG ? Looks to me like PNG would typically provide better image resolution for a similar filesize. Maybe I am wrong.

      Yep. You're wrong.

    • There's probably a commercial reason (companies agreed to support a common standard or something like that?).

      There's also a problem with compression ratios - PNG is lossless so it's improssible to compress beyond a certain point. With JPG you have much more ability to choose a point on the compression/quality tradeoff curve.
    • Re:Digital Cams ? (Score:3, Insightful)

      by rusty0101 ( 565565 )
      I would suspect that camera developers chose JPG because it was a specification from the Joint Photographers Group (hence it's name). If you are going to sell something to photographers, you want to tie it to a standard that photographers are expected to approve of.

      Note, I am not saying that it was the best standard to choose, simply that it made sense from a camera developer's standpoint.

      I doubt seriously that GIF will be a standard for camra developers to select and store to.

      I susect that for the forse
    • Re:Digital Cams ? (Score:3, Informative)

      by maxume ( 22995 )
      Yep, you are wrong.

      png uses lossless compresion. It basically is a format for zipped bitmaps.(as far as the compression works, it does a whole bunch of other stuff that bitmaps don't.)

      jpeg uses some lossy compression, and then goes ahead ahead and uses lossless on the output of the lossy compression stage. This yields smaller file sizes at a given image resolution(and thus better resolution at similar file size), by sacrificing some amount of quality. The reduction in quality is tunable, and using high qu
    • My understanding is that GIF/PNG are not technologically suited for photographic images. My understanding is that converesion of real-world/photographic images to GIF/PNG can result in some undesirable artifacts even though the compression is lossy. JPG's lossy compression prevents those artifacts and actually smooths out the image. GIF/PNG are said to be better suited for logos and other similar images: things that have relatively large regions of solid colors.

      I am certain that my understanding of the

    • Re:Digital Cams ? (Score:3, Informative)

      by pclminion ( 145572 )
      Could anyone on the know tell the rest of us why is it that digital cameras choose JPG as the compressed format instead of PNG?

      PNG doesn't handle photographs well. The compression in PNG comes from the zlib compression library. It is based on detecting repetitive patterns. In a photograph there do not tend to be repetetive patterns, because of the nature of the scene being photographed, and because of noise in the camera's light detecting instrument, which tends to break up any patterns.

      PNG has a set o

  • GIF is evil (Score:4, Funny)

    by fiannaFailMan ( 702447 ) on Thursday July 22, 2004 @02:49PM (#9772192) Journal
    Gif is only ever used for annoying animated banner ads! It's not capable of doing anything else! Gif is evil! Gif is used by bozos! I hate Gif! Yadda yadda yadda.....

    [There. That should earn me some karma if the recent Flash flame war is anything to go by.]

  • It's nice having choices, but don't think I'll be using GIF. PNG is better and enough browsers support it, basically.
  • screw gd, use imlib (Score:2, Informative)

    by xshader ( 201678 )
    gd is SLOW when rescaling images. out of all the libs i tested, imlib2 was the fastest by far. imlib2 scales all my images on my personal photo album on-the-fly and the processor usage is never an issue.

They are called computers simply because computation is the only significant job that has so far been given to them.