Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Patents Graphics IBM Software Your Rights Online

GIF Slips Away From Unisys; Your Move, IBM 609

Twenty years ago, Terry Welch's improvement on Lempel-Ziv compression appeared in IEEE Computer magazine. The authors of unix 'compress' and the GIF standard incorporated that algorithm without realizing it was patent-pending. When the submarine patent surfaced ten years later, its new owner Unisys intimidated developers and web authors into moving away from GIFs, inspiring the creation of a better standard, though sadly still a less popular one. Today, July 7, 2004, Unisys's last LZW patent (in Canada) expires, leaving GIF once again free... almost. See, there's the small matter of IBM's patent, granted on the same algorithm, which is valid for another two years. That still has a chilling effect on GIF development, though the consensus seems to be that IBM would lose any court action it tried to bring. So how about it, IBM? You've got nothing to lose! Want to make a lot of geeks happy and release that final patent into the public domain?
This discussion has been archived. No new comments can be posted.

GIF Slips Away From Unisys; Your Move, IBM

Comments Filter:
  • by NoMercy ( 105420 ) on Wednesday July 07, 2004 @09:04AM (#9630907)
    I'm not sure on the merits of the GIF format after all these years, the only thing it brings to the web expierence is flashing adverts, PNG provides full alpha-transparency which is really required for the future of web design.
  • by Ghengis ( 73865 ) <SLowLaRIS&xNIX,Rules> on Wednesday July 07, 2004 @09:06AM (#9630922) Homepage Journal
    Because GIF is used MUCH more, so people writing software that make use of images in general (browsers, image editors, etc.) have to deal with this patented algorithm, or risk losing users because their software doesn't support one of the most widely used formats.
  • by Anonymous Coward on Wednesday July 07, 2004 @09:06AM (#9630926)
    It's hard to do away with GIF because GIF's are animated. PNG's are not. There's the MNG standard, which is basically an animated PNG, but it isn't widely supported yet.
  • by ultrabot ( 200914 ) on Wednesday July 07, 2004 @09:08AM (#9630951)
    Real link is here [linuxinsider.com]
  • by Davak ( 526912 ) on Wednesday July 07, 2004 @09:08AM (#9630956) Homepage
    Quick source view of the main slashdot page shows that "gif" is found about 50 times.

    "png" is found twice -- both of which are related to the original post.

    Now you know why we care. The web community uses gif more than png. For better or worse...

    Davak
  • by I confirm I'm not a ( 720413 ) on Wednesday July 07, 2004 @09:09AM (#9630962) Journal

    You're talking about an obsolete technology [GIF] that nobody cares about.

    I'd question that. Check Google images [google.com] and see how many web sites still exclusively use .gifs. Not to mention a certain main-stream browser whose support for .pngs is still patchy.

    I guess you and I have different definitions of "obsolete".

  • Re:PNG's..... (Score:5, Informative)

    by eddy ( 18759 ) on Wednesday July 07, 2004 @09:13AM (#9630997) Homepage Journal

    You can't make animations with PNG files....

    Sure you can, only the result is called MNG [libpng.org].

  • by julesh ( 229690 ) on Wednesday July 07, 2004 @09:14AM (#9631013)
    Compatibility. A huge number of existing web sites still use GIF as their primary image format. We need to be able to produce software that can manipulate these images if we want any hope of penetrating the web authoring market. This has prompted many workarounds in the past (such as libungif, a piece of software that produces GIF files without using the patented algorithm -- but unfortunately this means not having any compression) which will become obsolete once all patent issues have been cleared up.

  • by NoMercy ( 105420 ) on Wednesday July 07, 2004 @09:16AM (#9631036)
    Everything which supports modern CSS styling supports PNG... it's just not everything supports all the features of PNG, the most noted case being IE doesn't support alpha-transparency.

    Many people also believe PNG's to generally produce larger images to GIF, if youre generating PNG's using the 'recomended settings' then yes for many images this is the case, but if your image doesn't need 16.7 milion colors and full alpha-transparency, don't enable them switch to pallete based with no-transparnecy.
  • not even close! (Score:5, Informative)

    by Ender Ryan ( 79406 ) <MONET minus painter> on Wednesday July 07, 2004 @09:16AM (#9631037) Journal
    IE does not support the #1 most useful aspect of PNG, namely, alpha transparency. Without alpha transparency, you may as well use JPEG or GIF in most circumstances.

    Indeed, the web would be much more beautiful if IE supported alpha transparency in PNGs.

  • LZW tiff, too (Score:3, Informative)

    by Willard B. Trophy ( 620813 ) on Wednesday July 07, 2004 @09:16AM (#9631042) Homepage Journal
    Does this mean we can get LZW compression back in libtiff [libtiff.org] too, then? It would be really nice to be able to supply compressed press-ready images to printing houses.

    Yeah, I know there are deflated TIFFs, but they can be like "wha...?" in the prepress world.

  • by djmurdoch ( 306849 ) on Wednesday July 07, 2004 @09:21AM (#9631080)
    The original Welch paper is pretty readable:

    Terry A. Welch, "A Technique for High Performance Data Compression", IEEE Computer, Vol. 17, No. 6, 1984, pp. 8-19.

    If you don't want to go to a library and look that up, then Google will find you about 12000 hits on "Welch LZW", and the first few all seem to be exactly what you want.
  • Re:PNG's..... (Score:2, Informative)

    by 91degrees ( 207121 ) on Wednesday July 07, 2004 @09:26AM (#9631127) Journal
    But GIF is the worst format for animations ever!
  • Re:in any case (Score:2, Informative)

    by Anonymous Coward on Wednesday July 07, 2004 @09:27AM (#9631134)
    Alpha channels are useful for antialiased drawings that are not dependant on a specific background.
  • Re:Mod parent up! (Score:2, Informative)

    by Anonymous Coward on Wednesday July 07, 2004 @09:27AM (#9631141)
    But Slashdot's current HTML isn't standard either. I've had modern browsers completely barf on some of the slashcode output, splitting the screen in half. They are still using the CENTER and FONT tags, and ANY properly-written older browser will ignore newer HTML or CSS stuff. If you are running a low end machine, stick with a properly written low end browser. Don't blame new standards for odd rendering in old, crappy browsers.
  • Because of the LZW compression algorhythm.

    It's still superior to PNG's compression and I hazard a guess that PNG can be modified to use LZW.
  • by gl4ss ( 559668 ) on Wednesday July 07, 2004 @09:28AM (#9631148) Homepage Journal
    the whole ruckus was because they did publish the algorithm widely and it got used widely - and only then did they reveal their submarine.

    the algo is/was very widely known.
  • by FinestLittleSpace ( 719663 ) * on Wednesday July 07, 2004 @09:28AM (#9631151)
    AFAIK, lossless means that no matter how many times you RE-save an image, it doesnt lose image data; in which case, yes, a GIF IS lossless.
  • by yourruinreverse ( 564043 ) on Wednesday July 07, 2004 @09:29AM (#9631161)
    So how about it, IBM? You've got nothing to lose! Want to make a lot of geeks happy and release that final patent into the public domain?

    Actually that patent is being used in IBM's (second amended) counterclaims [groklaw.net] in the SCO v IBM case.

  • Re:in any case (Score:4, Informative)

    by RazzleFrog ( 537054 ) on Wednesday July 07, 2004 @09:31AM (#9631172)
    bloating their sites with transparent effects where it is not needed.

    Every once in a while somebody seems to open their mouth without realizing they have no clue what they are talking about.

    How exactly is a transparent image bloat? I did a test. As a gif a logo I have is 3.32K without alpha and 3.33K with alpha. A PNG (both regular and alpha) it was 3.45K. That should dispel both the claims that PNG is bigger and that transparency adds bloat.

    And what do you do everytime you change a websites background color? Change the image?
  • by Anonymous Coward on Wednesday July 07, 2004 @09:31AM (#9631178)
    Ever tried Google? Try searching "GIF file format".

    Even the first link has info on the format, except that particular info is hard to read. I've seen better documets about the subject.

    For just the plain LZW algorithm, try this .pdf [innerlighttheory.com] at The Scientist and Engineer's Guide to Digital Signal Processing [dspguide.com] website.

    - Jeppe Jääkarhu
  • by iantri ( 687643 ) <iantri&gmx,net> on Wednesday July 07, 2004 @09:35AM (#9631205) Homepage
    Except the browsers all support PNG (minus alpha, but GIF and JPG don't have that anyway), where as most MP3 players can't play Vorbis..
  • by Kjella ( 173770 ) on Wednesday July 07, 2004 @09:36AM (#9631215) Homepage
    ...MNG code is not very good to begin with, I believe MNG support was ditched from Mozilla as well, which makes it supported in approximately 0% of the web browsers out there.

    I use PNG quite a bit, but mainly as a competitor to TIF files, but I do prefer to use PNG over GIF in websites too. However, I'm only using non-transparent, plain PNGs for maximum compatibility.

    Animated GIFs? Oh, right. I turned those off, along with pop-ups. If I wanted that, I'd actually use flash or something like that. I figure either you don't block stuff (which means GIF + flash) or you block stuff, in which case you don't see either. Either way, I don't see much room for GIF files...

    Kjella
  • IE can work with PNG (Score:4, Informative)

    by Patik ( 584959 ) * <.cpatik. .at. .gmail.com.> on Wednesday July 07, 2004 @09:43AM (#9631270) Homepage Journal
    Just use Sleight [youngpup.net] to make PNG transparency work with IE on your site.
  • by Azrael Newtype ( 688138 ) <c.a.eads@gmail.com> on Wednesday July 07, 2004 @09:49AM (#9631324)
    Ha, beat me to it by being more concise. And to think he got the informative mod. C'est La Vie

    To reiterate, GIF is essentially lossless, but only in two conditions: The image is less than 256 colors raw, or the image was a gif originally (basically the same condition.) Now, PNG is also lossless, and while GIF is still the most common standard, Mozilla supports PNG well, and IE pretends to support it resulting in an okay method, meaning it doesn't have to remain standard. After all, [intentionally ridiculous analogy]the horse and buggy was once the standard for transportation.[/intentionally ridiculous analogy]

  • by Alizarin Erythrosin ( 457981 ) on Wednesday July 07, 2004 @09:52AM (#9631348)
    This is true. It is counterclaim #175:

    175. IBM is the lawful owner, by assignment, of the entire right, title and interest in United States Patent No. 4814746 ("the '746 Patent"), duly and legally issued on March 21, 1989 to Miller et aI., entitled "Data Compression Method". A copy of the ' 746 Patent is attached hereto as Exhibit X.


    176. Upon information and belief, SCO has infringed, contributorily infringed and/or actively induced others to infringe the '746 Patent within this judicial district and elsewhere in violation of35 U. C. 9271 by, without authority or license from IBM, (a) making, using, selling and/or offering to sell products, including Unix Ware and Open Server, that practice one or more claims of the '746 Patent and (b) actively, knowingly and intentionally causing and assisting others to infringe one or more claims of the' 746 Patent.

    While it would be nice for IBM to release the patent to the public domain, they would have to drop this particular claim from the SCO lawsuit if they did.
  • by Jabes ( 238775 ) on Wednesday July 07, 2004 @09:53AM (#9631356) Homepage
    GIF is pronounced JIF.

    Bob Berry, the developer of CompuShow for CompuServe (remember them - the people that invented the GIF format?) included with it an animated GIF89 format file that had a picture of him. It had a speach bubble with him saying:

    Oh, incidentally, it's pronounced "JIF"

    A quick google later and I've found a web site which has this, and other evidence that .GIF files are pronounced JIF

    http://www.olsenhome.com/gif/

    Thanks for playing
  • by Anonymous Coward on Wednesday July 07, 2004 @10:06AM (#9631487)
    pngcrush is better still, go grab it off sourceforge.
  • Re:in any case (Score:5, Informative)

    by photon317 ( 208409 ) on Wednesday July 07, 2004 @10:07AM (#9631492)
    Exactly. I'm not a full-time web developer, so I don't even think on these issues too hard most of the time. Recently I had to write a little network-monitoring app. I coded the output in standards-compliant XHTML 1.1, standards-compliant CSS for styling stuff, and I used PNGs with transparent backgrounds for certain little icons. I only tested my app in Firefox (yeah, my mistake). Later someone who actually uses IE tried to use my little web app, and found gray background squares around all my supposedly transparent-backgrounded images. Sucked. Now I know what all you web developers already knew - I have to put a background color on these pngs which matches the background they're placed on that I specified in my stylesheet. How redundant and stupid.
  • by SiMac ( 409541 ) on Wednesday July 07, 2004 @10:07AM (#9631497) Homepage
    PNG transparency works just fine in Internet Explorer. It's just a pain in the ass.

    This website [eae.net] will tell you how to turn it on. You can see it working on my website.

    No idea why it's not on by default, but if it works...
  • Re:PNG's..... (Score:5, Informative)

    by boutell ( 5367 ) on Wednesday July 07, 2004 @10:10AM (#9631529) Homepage
    Just to set the record straight:

    When I led the process of drafting the PNG specification, GIF animation did not yet exist. Animation was not part of the original GIF specification. The GIF89a specification *did* offer a mechanism for including multiple images in a single file, and a very basic (but, in retrospect, effective) mechanism for replacing only a specified part of the preceding image. But whether this was supposed to be animation with a time component was never defined, and there was in fact no way to specify how long each frame was supposed to appear, probably because the real intent was to be able to compose a single final still image from many sections. Multiple image GIFs were a footnote to the GIF specification which hardly anybody used until Netscape stepped in.

    Netscape's animated GIF format was a clever hack on top of this: they defined a new GIF chunk to specify the pause between frames.

    Here's the kicker: Netscape was repeatedly invited to participate in the PNG design process. They had someone reading the list, I gather, but they never offered any suggestions or contributions. If they had, they would likely have been considered very seriously.

    But instead, the first we heard of GIF animation was its public release in Netscape (2.0 beta, if I recall correctly). They could have contributed to the design of a PNG or MNG that did include animation and, by way of that compelling feature, would have been more likely to quickly replace GIF. But they didn't.

    We (the PNG designers) did consider retrofitting animation into PNG when Netscape's animated GIF appeared. In fact, I lobbied for that at one point. Unfortunately we had already finalized the functional specification and there was no hope of reaching agreement on how to "jam in" the animation feature at the last minute on top of an otherwise pretty elegant image format.

    Instead, the MNG group was formed to create a specification for a powerful lossless animation format. And they succeeded -- but MNG has yet to really catch fire, and animated vector formats like SWF and SVG are gradually replacing animated GIF anyway for most purposes. At the end of the day, lossless bitmap animation is a pretty bandwidth-intensive proposition.
  • by julesh ( 229690 ) on Wednesday July 07, 2004 @10:11AM (#9631544)
    Because Unisys only ever threatened users of the GIF format with legal action; they considered other uses of LZW as acceptable.
  • Re:PNG (Score:5, Informative)

    by caseih ( 160668 ) on Wednesday July 07, 2004 @10:14AM (#9631569)
    See http://www.daltonlp.com/daltonlp.cgi?item_type=1&i tem_id=217 [daltonlp.com] for how to get pngs to display transparency on IE 5.5 and IE 6. This is now a well-known technique that works pretty well universally. Combine with CSS or javascript and you should be able to use pngs entirely.
  • Re:PNG vs. JPEG (Score:5, Informative)

    by julesh ( 229690 ) on Wednesday July 07, 2004 @10:19AM (#9631616)
    No. JPEG at max quality looks perfect to the human eye, but it still has differences from the original image. Lossy compression should be avoided in situations where images are going to be decoded and recoded many times, as these errors build up to the point where they can become noticeable.

    Also: make sure your PNG encoder is configured correctly. In most cases you want to be using the 'adaptive' filter.
  • by RAMMS+EIN ( 578166 ) on Wednesday July 07, 2004 @10:25AM (#9631678) Homepage Journal
    ``Basically it's just a much nicer version of GIF's transparency.''

    Or, actually, what GIFs have is transparency, whereas PNGs have an alpha channel, which allows for the specification of translucency - or opacity which is the opposite quality.
  • Re:not even close! (Score:4, Informative)

    by Mr_Silver ( 213637 ) on Wednesday July 07, 2004 @10:27AM (#9631692)
    ...then what's stopping you from using it? 5% or browsers will benefit;

    Because when you're working on a corporate project that costs money, it's very difficult to put a business case forward for something which will only be of benefit to a very small number of visitors.

    Most clients would rather pay for something that directly benefits the browsing experience of the other 95%.

  • by Nurgled ( 63197 ) on Wednesday July 07, 2004 @10:47AM (#9631921)

    In some limited circumstances it's possible to use alpha-transparency while gracefully degrading in IE.

    For example, if you are using a solid-colour or almost-solid-colour partially-transparent image to achieve some kind of shading or tinting of the underlying background, you can do this and let IE display it as solid rather than transparent. People who only use IE will never know it was meant to be transparent and thus won't care.

    The major trip-up here is that IE renders alpha-transparent PNG onto an unpredictable background colour. However, you can bypass this by adding a background colour chunk (bKGD, or something like that; it's been a while) specifying which solid colour you wish IE to render to. It will then render to that color and create the image with that color "showing through".

    The limitations of IE's rendering are due to how IE was originally built to handle images. The image loaders hand the rendering component some kind of bitmap and a 1-bit transparency mask. This was a good choice at the time, but then alpha-transparent PNG came along, and since at the time GDI didn't have any mechanism to support alpha-transparency they just bodged it with the background color. At the time it didn't matter because no-one was using PNG anyway.

    The new version of IE will hopefully support alpha-transparency since as of Windows 2000 GDI supports 32-bit images with (alpha,r,g,b) components, and there's already a PNG loader in the gdiplus library, so supporting it will be pretty trivial.

  • Re:PNG vs. JPEG (Score:5, Informative)

    by RAMMS+EIN ( 578166 ) on Wednesday July 07, 2004 @10:49AM (#9631938) Homepage Journal
    I'll bite.

    JPEG, like MPEG (and Vorbis, Theora, ...) changes an image in such a way that humans don't percieve the difference, but it can be stored more efficiently. At lower qualities, you will begin to notice some artifacts. It can go all the way down to a completely useless collection of pixels. It's a common misconception that 100% quality JPEG images are not distorted in any way. I don't know what 100% means, other than the lowest compression your encoder supports.

    PNG images, on the other hand, encode the image exactly as it looks. Basically, a PNG image is a collection of pixels, some metadata, optionally compressed with deflate (same algorithm used by gzip).

    JPEG images are the better choice for photograpic images (which is what they are intended for), where the exact pixel colors don't matter that much. PNG is better for line drawings, text, high contrast images; basically anything that doesn't bear slight changes to the colors. For large images, JPEG can be significantly smaller, making the case for using JPEG for screen dumps and such.
  • by ajs ( 35943 ) <{ajs} {at} {ajs.com}> on Wednesday July 07, 2004 @10:50AM (#9631953) Homepage Journal
    Alpha transparency is critical to good Web site design for many reasons. Among them:

    1. Blending with any background means you can change the background globally and not worry about re-blending all of the images.
    2. An image which is produced externally (e.g. by a partner) can blend with your layout cleanly without being customized.

    However, MOST uses of alpha blending in web design would ACTUALLY be better done in SVG if SVG in browsers could finally get first-class status.

    Why? Well, just for starters, LCDs and CRTs have different optimial anti-aliasing strategies. If I want to put a circle on a Web page, right now I have to choose one of those strategies ahead of time (or resort to a plug-in). If we allow SVG "images", then we can simply render that circle however the user directs it to be (presumably because they've selected a "CRT-friendly" or "LCD-friendly" preference in their browser or desktop).

    Once you eliminate anti-aliasing as a concern, there are still reasons to do alpha-blending in regular images (such as those above), but the general case (logos, text, shapes, etc) will be handled more cleanly.
  • by DVega ( 211997 ) on Wednesday July 07, 2004 @10:57AM (#9632056)
    Mozilla used to support MNGs, but that support was removed in orther to reduce "cruft".

    If you would like to get MNG back into Mozilla, then you can follow/vote/contribute to Bugzilla bug 18574

    http://bugzilla.mozilla.org/show_bug.cgi?id=1857 4

    (Please don't post useless comments on that bug)

  • by CoughDropAddict ( 40792 ) on Wednesday July 07, 2004 @11:01AM (#9632092) Homepage
    Hello? People don't complain that LZW is obvious. They complain that Unisys sat on the patent for ten years while it found its way into standard data formats like gif and compress. Hence the term "submarine patent."
  • by N Monkey ( 313423 ) on Wednesday July 07, 2004 @11:04AM (#9632123)
    I suspect that it was a combination of several things:
    1) Until recently, the US didn't publish the applications, only the granted patents, and the lifetime of the patent was from date or grant, not date of filing. There was the tendancy for the applicants not to bother rushing things through. (dare I say submarining).

    Note that elsewhere, patent applications became public after, IIRC, 18 months and their lifetime started from the date of filing - there was no point in being tardy.

    2) I suspect that, back then, searching existing patents was probably a lot more difficult. It wouldn't surprise me if it was all done manually which'd be utterly tedious. It's bad enough with online electronic systems. :-(

    3)It is the responsibility of the patenter to inform the patent office if new information/documents comes to light and to update their patents accordingly (I've done this with one of mine) but I guess researchers can move on to other fields, change employers, or simply lose interest. (shrug)
  • Re:oh well.... (Score:2, Informative)

    by operagost ( 62405 ) on Wednesday July 07, 2004 @11:36AM (#9632449) Homepage Journal
    Somehow, your post reminded me of this [penny-arcade.com].
  • by Anonymous Coward on Wednesday July 07, 2004 @11:47AM (#9632560)
    For those who love irony, here it is in PNG format [sochi.net.ru].

  • by Anonymous Coward on Wednesday July 07, 2004 @11:57AM (#9632674)
    > Flash? bah, talk about bloated.

    The plugin is 200K. Flash movies are typically smaller than a single image. You can rant all you want about flash, but I don't think you can call it bloated.
  • Re:not even close! (Score:2, Informative)

    by PeterPumpkin ( 777678 ) on Wednesday July 07, 2004 @12:06PM (#9632763) Journal
    In what way is promoting increased use of PNGs unrealistic?

    Well you have to promote them fully. Alpha transparency works fine in IE 5.5+, you just have to know the hack. See this site [sectormedical.com] for a working example.

    The method is explained here [eae.net]
  • by BlueWonder ( 130989 ) on Wednesday July 07, 2004 @12:08PM (#9632785)
    A patent is open, so everybody can learn from it, but making money of it is limited to the patent holder.

    Actually, you cannot (legally) use a patented technology without permission from the patent holder, even if you don't make money from it.

  • by htmlboy ( 31265 ) on Wednesday July 07, 2004 @12:09PM (#9632803)
    Quick source view of the main slashdot page shows that "gif" is found about 50 times.

    "png" is found twice -- both of which are related to the original post.

    Now you know why we care. The web community uses gif more than png. For better or worse...


    i'm not sure this web community would be pleased that slashdot's being used as an example of currently-accepted design choices. at least on the front end, slashdot's code is dated and inefficient. alistapart.com has a fun article [alistapart.com] on how it could be made better.
  • by Coneasfast ( 690509 ) on Wednesday July 07, 2004 @12:13PM (#9632839)
    bingo! mod parent up. everyone should be using PNG now. IE supports png binary transparency just fine. so you can do a straight conversion of all your gif->png and you will have no problem.

    also, png's will almost always be smaller if optipng is used to optimize the compression
  • Main #1 problem with that: it relies on DirectX, which, if you have any brains, is turned OFF on IE.

    Oh wait.

    I forgot all of the morons who leave it on.

    My Mistake. Guess it will work after all.
  • by Snowmit ( 704081 ) on Wednesday July 07, 2004 @12:15PM (#9632858) Homepage
    Item 2 has been shot down because the majority doesn't rule on matters of punctuation. (pronounciation?)

    Actually, the majority do rule on matters of pronounciation when it comes to English. The major linguistic project of English (the Oxford English Dictionary) is a descriptive not a prescriptive document. That means that once a significant minority of English users use or pronounce a word in a certain way, it'll get recorded in the dictionary.

    All this is just to say that both "jif" and "gif" are acceptable pronounciations of GIF.
  • by carou ( 88501 ) on Wednesday July 07, 2004 @12:15PM (#9632859) Homepage Journal
    You can indeed get IE 5.5 and above on Windows to display PNG images with alpha transparency, by using IE's built-in DirectX filters against themselves. For example:

    <div style =" width: 36px; height: 52px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader (src='images/next.png', sizingMethod='scale', enabled='true'); display:inline-block"><img src="images/next.png" alt="IE-compatibility link" width="36" height="52" style="filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0) ;"></div>

    This doesn't interfere with other browsers which support PNG natively because they just see the standard IMG tag and ignore the filter stuff. Whereas on IE, the filter in the IMG tag prevents the (wrong) image from being displayed, and the one in the DIV tag actually does display it properly. Goodness knows why they make you jump through the hoops though; given the IE on MacOS just works, it's obvious that Microsoft as a company don't have a problem with understanding or implementing the specs. Do they just not share code between platforms in Redmond, or what?
  • by chrish ( 4714 ) on Wednesday July 07, 2004 @12:23PM (#9632942) Homepage
    And here [ntlworld.com] is how you force IE into properly supporting PNG transparency.

    Works like a charm, doesn't introduce any MS "extensions" into your documents, and doesn't do anything if the user is smart enough to be using a web browser that actually supports standards.
  • Re:not even close! (Score:3, Informative)

    by ncc74656 ( 45571 ) * <scott@alfter.us> on Wednesday July 07, 2004 @12:32PM (#9633033) Homepage Journal
    IE does not support the #1 most useful aspect of PNG, namely, alpha transparency. Without alpha transparency, you may as well use JPEG or GIF in most circumstances.

    FWIW, there's a hack to display transparent PNGs in IE without breaking things for other browsers. Try this script:

    <script type="text/javascript">
    function DisplayPNG (id, path, xdim, ydim, alttext)
    {
    if ( navigator.userAgent.indexOf ("MSIE") != -1 )
    {
    document.write ( '<div style="height: ' + ydim + 'px; width: ' + xdim + 'px; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader (src = \''+path+'\', sizingMethod=\'scale\')"> </div>');
    }
    else
    {
    document.write ('<img src="'+path+'" width='+xdim+' height='+ydim+' alt="'+alttext+'" title="'+alttext+'">');
    }
    document.getElementById(id).innerHTML = "";
    }
    </script>

    I inserted a few extra spaces so that /. would hopefully not mangle it into non-working form, but if it doesn't work, you can get a working copy of the script here [alfter.us].

    Where you'd normally put an IMG element to load a PNG, use something like this instead:

    <span id="foo">
    <img src="graphics/foo.png" width=320 height=240 alt="This is the Foo image" title="This is the Foo image">
    </span>
    <script type="text/javascript">
    DisplayPNG("foo","graphics/foo.png",320,240,"This is the Foo image");
    </script>

    The first parameter of the DisplayPNG script is the ID of the span element that precedes it; this displays the PNG if JavaScript is disabled (though it won't be transparent on IE). The second parameter is the path to the file, the third and fourth are the dimensions, and the fifth is some identifying text that'll show up in the image's tooltip.

    I'll allow that it would be better if Microsoft had done a proper implementation of PNG in IE, but this gets the job done until that happens (if it ever does).

  • by 5n3ak3rp1mp ( 305814 ) on Wednesday July 07, 2004 @12:40PM (#9633115) Homepage
    This is actually doable, it's just convoluted and requires a browser-detect. I did this at a client last year. Google "alphaimageloader png internet explorer" for info.
  • by callipygian-showsyst ( 631222 ) on Wednesday July 07, 2004 @12:41PM (#9633128) Homepage
    Here's [data-compression.com] an animation of how L-Z compression works.

    If you're smart enough to come up with the next great compression algoritm, I encourage you to do so!

  • by Anonymous Coward on Wednesday July 07, 2004 @12:44PM (#9633153)
    IANAL, but this is one of the key ways in which patents differ from, say, trademarks. The patent owner owns the patent and does not lose their intellectual property if they do not enforce it. (Else submarine patents would be impossible.)
  • Re:PNG (Score:1, Informative)

    by Anonymous Coward on Wednesday July 07, 2004 @01:06PM (#9633366)
    Or better yet, http://dean.edwards.name/IE7/ [edwards.name] and fix more than just PNG alpha.
  • by sideshow ( 99249 ) on Wednesday July 07, 2004 @01:32PM (#9633622)
    The browser could never know if ASP or JSP or neither was used.
  • by ^_^x ( 178540 ) on Wednesday July 07, 2004 @01:53PM (#9633826)
    GIFs can be used properly [greatnet.de] to good effect. Just don't convert a high-color picture to GIF automatically. *shrug* Much the same way you could compress an AVI in 16 colors then say AVI sucks.
  • Re:PNG vs. JPEG (Score:3, Informative)

    by pclminion ( 145572 ) on Wednesday July 07, 2004 @01:59PM (#9633878)
    But that didn't answer his question at all. He mentioned a specific example, and you give a textbook response.

    The question is, why not use JPEG if it results in smaller files and no visible artifacts? I think the answer to that question is, there IS no reason not to. If the compression fits your application, use it. Don't make decisions based on generalizations and textbook answers.

    Will there be artifacts? Perhaps. But what is relevant, of course, is whether they are perceptible, and beyond that, whether they are distracting.

    Don't just blindly follow rules of thumb. Do a real experiment, like the OP's colleague did. If a certain type of compression works best in your application, then use it. Don't discard options based on theory, especially when direct experience contradicts it.

    Oh, and a small nitpick: PNG is not optionally compressed. The compression is mandatory.

  • by santiago ( 42242 ) on Wednesday July 07, 2004 @03:49PM (#9634938)
    Several people have posted workarounds to enable the full-alpha support of PNGs under IE, but all the ones I saw require changing each and every image tag that points to a PNG. The following chunk of JavaScript takes care of all PNGs without any other changes to the HTML source. (Like other methods, it requires a 1 x 1 pixel transparent GIF image as a placeholder.)
    if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
    document.writeln('<style type="text/css">img { visibility:hidden; } </style>');
    window.attachEvent("onload", fnLoadPngs);
    }

    function fnLoadPngs() {
    var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
    var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);

    for (var i = document.images.length - 1, img = null; (img = document.images[i]); i--) {
    if (itsAllGood && img.src.match(/\.png$/i) != null) {
    var src = img.src;
    img.style.width = img.width + "px";
    img.style.height = img.height + "px";
    img.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoade r(src='" + src + "', sizingMethod='scale')"
    img.src = "/blank1x1.gif";
    }
    img.style.visibility = "visible";
    }
    }
  • Re:Indeed they do. (Score:3, Informative)

    by HaggiZ ( 68526 ) on Wednesday July 07, 2004 @10:41PM (#9638454) Homepage
    IANAL, but my understanding of patent law is that when the patent is granted you must prosecute any infringements you are aware of. No getting to pick your battles. And you must file suit within a reasonable time period.

    Failing to do so voids your patent.

    At least, I'm almost certain that is how it works here in Australia.

Real Programmers don't eat quiche. They eat Twinkies and Szechwan food.

Working...