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!"
Nice GD Info (Score:5, Informative)
var_dump(gd_info());
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:
PHP (Score:2)
Re:PHP (Score:3, Informative)
Re:PHP (Score:3, Insightful)
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)
Did anyone really stop using gifs? (Score:3, Insightful)
Re:Did anyone really stop using gifs? (Score:2, Insightful)
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.
Re:Did anyone really stop using gifs? (Score:2)
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.
Re:Did anyone really stop using gifs? (Score:2)
Re:Did anyone really stop using gifs? (Score:2)
Re:Did anyone really stop using gifs? (Score:2)
The big dawgs bought licenses bro.
-davidu
Or maybe they paid? (Score:2)
Use your brain, it's there for a reason
Wrong (Score:5, Insightful)
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).
-Dan
Re:Wrong (Score:3, Insightful)
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.
Re:Did anyone really stop using gifs? (Score:2)
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?
-Rusty
Re:Did anyone really stop using gifs? (Score:4, Informative)
Re:Did anyone really stop using gifs? (Score:2)
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
Re:Did anyone really stop using gifs? (Score:2)
No, what I'm saying is "Yes, I did, with some exceptions (like on the internet)".
Re:Did anyone really stop using gifs? (Score:2, Interesting)
So while PNG might be technically or whatever superior and though I appreciate PNG for many uses as well I am still glad GIF has returned to GD.
Re:Did anyone really stop using gifs? (Score:5, Insightful)
Bah. A pox on GIFs!
Now if only Adobe could get off their lazy crappy-programmer asses and put proper PNG compression in Photoshop so we wouldn't _need_ programs like pngcrush & pngout.
PNG Software support (Score:2)
PNG seems to be a good example of the second-system effect [clueless.com], where a simple implementation is replaced by "elephantine feature-laden monstrosity", that took a long time to develop, and is difficult to implement correctly. When the largest graphics companies, Adobe & Macromedia, have problems, you have to wonder.
Not that PNG doesn't have its uses, but if the goal was to
Re:PNG Software support (Score:2)
Certainly using _IE_, of all programs, as an example, does NOT help your argument in the lea
Re:PNG Software support (Score:2)
+ It took many years after the GIF Patent was identified to develop and release the PNG standard.
+ It took many years after that until there was even basic software support was in place.
+ For whatever reason, there's not enough customer demand for vendors to fully support PNG.
+ The patent expired, so there's no real objection to using GIF anymore.
With hindsight, PNG was too much, too late. Which is why "Burn Al
Re:PNG Software support (Score:2)
The patent problems with GIF were far from the only objections to GIF. I'm not returning to GIF now that they're gone - PNG is simply superior in every reasonable way for my needs. I'd just like Adobe & MS to fix their broken software so life is a bit easier. Returning to GIF isn't going to solve any problems for me, or for most people.
Re:PNG Software support (Score:2)
Yes, your perspective is entirely different, you've already eaten the conversion costs. But "most people" never switched to PNG to begin with, and won't until it's easy and it does solve a problem.
Re:PNG Software support (Score:4, Informative)
(b) the worldwide patents on LZW have not yet expired! It's arguable whether the following patent is valid, but IBM was issued a patent on *the same algorithm* covered by the Unisys patent -- and IBM's patent is good for another two years:
United States Patent No. 4814746 issued in 1989.
Re:PNG Software support (Score:2)
IMNSHO, it just shows that MS and Adobe can't use a simple Open Source reference library [libpng.org]. There should be no excuse about it being difficult to implement. It's already implemented! And from reading the simple license [libpng.org], it appears to be BSD-like. So there should be none the worries or problems that commercial outfits seem to have with the GNU GPL. Where's the problem?
Oh, and if you want to complain about an elephantine feature-laden monstrosity, check out PNG's cousin - MNG [libpng.org]
Re:Did anyone really stop using gifs? (Score:2)
Actually, PNG has the particular issue that the colormap is not compressed. They should have just compressed the whole stream. They should also add an option (required by all readers) to use BZIP2 compression, since it does a much better job than GZIP on most images and the BZIP2 library is just as open and has the same interface as ZLIB.
Also, GIFs can us
Re:Did anyone really stop using gifs? (Score:2)
Re:Did anyone really stop using gifs? (Score:2)
Actually, PNG has the particular issue that the colormap is not compressed. They should have just compressed the whole stream. They should also add an option (required by all readers) to use BZIP2 compression, since it does a much better job than GZIP on most images and the BZIP2 library is just as open and has the same interface as ZLIB.
Excpet that bzip is a block compression algorithm, meaning the files have to be multiples of a fixed sized. For web images, you just negated the advantage you got from i
Re:Did anyone really stop using gifs? (Score:2)
Bzip2 provides a modest to moderate decrease in file size at the expense of huge increases in compression/decompression time. A nice comparison can be found at http://www.elis.ugent.be/~wheirman/compression/ [ugent.be]. Gzip seems to occupy a nice sweet-spot between file size and avoiding thumb-twiddling.
Re:Did anyone really stop using gifs? (Score:2)
Re:Did anyone really stop using gifs? (Score:2)
I may owe you an apology... (Score:5, Informative)
I used to work for a company named Mastersoft, which was acquired by Frame, the makers of Frame Maker (the now-discontinued DTP app); Frame was subsequently acquired by Adobe.
While at Mastersoft, I developed an implementation of a PNG reading and writing library for use in various file format conversion products; these reading and writing libraries were also licensed to OEMs for inclusion in other commercial products, so they're in a lot of places. The libraries I wrote used Jean-Loup Gailly's (sp?) zlib (since I didn't want to reinvent the wheel and debug a compression library), but did not rely on the pnglib reference implementation in any way.
I was very proud of the fact that my libraries were the first commercial implementation of PNG, as far as I can tell. However, due to time constraints and some performance requirements, the compression done by my PNG writer libraries wasn't the best. Specifically, I avoided using any scanline filter type other than Paeth for my PNG writing library; most modern PNG writers will try all 5 filter types on each scanline, and see which compresses the best. My choice had the virtue of saving time in writing a PNG file to disk, but doesn't necessarily produce the smallest PNG files. I also used a relatively small PNG chunk size; since each chunk has some overhead, more chunks means larger PNG files. Lastly, the version of zlib that I used was current as of the drafting of the original PNG specification; subsequent versions of zlib were released which were slightly more efficient, and a few nasty bugs were stomped out.
I don't know if Adobe is using my PNG writing code in Photoshop, but since Adobe purchased the IP of Mastersoft in the Frame acquisition, it's not inconceivable that they used my code rather than writing their own. If they used my code, then it's quite possible that I'm to blame for Photoshop saving out crappy PNG files that are too big.
In my defense, though, I should say that many people did manage to compress existing GIF files using my PNG library (which shipped as part of the Mastersoft File Utilities by Adobe, a product that unfortunately didn't last long); one magazine reviewer specifically used this software suite to convert a bunch of GIFs to PNGs, and concluded that in most cases, the PNGs were indeed smaller.
As soon as you start dealing with non-indexed color images, though, PNG is no better than TIFF. Some folks might incorrectly try to take a 24-bit source image and save as PNG, then take the same source and save as GIF, and will note that the GIF is way smaller -- as it should be, since GIF doesn't support 24 bpp images, whereas PNG does. To save a 24-bit source image as GIF, you have to first reduce the color space and convert to an indexed color image, since that's the only type of image that GIF can store. With PNG, the bit depth of the original is preserved. (And since PNG supports up to 16 bits per channel, and supports up to four channels -- R, G, B, and Alpha -- you can see how a PNG image can get obscenely large. This is where it pays to manage your expectations and understand the features and limitations of the file format.)
Re:I may owe you an apology... (Score:4, Insightful)
*If* MS and Adobe were free software projects, Adobe would have gotten its simplified PNG library and had a product to market just as quickly. Another person could then have come along and at a later date and implemented the remaining filters. In this way Adobe gets a working product quickly, but at a later any missing features get filled in.
As it is the proprietory model delivered the fast product, but missed out on the 'incremental improvement' stage.
Re:Did anyone really stop using gifs? (Score:2)
In Photoshop, if your image has 8-bit colours or fewer, change the mode to 'Indexed,' and that drops it from 24-bit down to 8-bit. Then when you 'Save for the Web,' you need to re-select the colour depth you want most of the time (stupid Photoshop will usually assume full 8-bit even if it knows there are fewer), then you get down to the exact-size palette you need. Play around with dithering colours to use even smaller palettes (perceptual works quit
Yes, many of us really did stop using GIFs! (Score:2)
Re:Did anyone really stop using gifs? (Score:3, Insightful)
Now maybe the PNG compresor is a piece of crap in IR. How am I supposed to know? I'm not going to try 100 different compressors.
A format that has no decent popular implementation will fail. No matter how good it is. This is a MAJOR problem for PNG. And it is not a user error.
Re:Did anyone really stop using gifs? (Score:2)
Re:Did anyone really stop using gifs? (Score:5, Interesting)
> do you get the point I am making?
Yep, I do. People like YOU are posers. CSS is hardly 'bleeding edge.' People like YOU are what's holding back 4-year-old standards from becoming requirements. The point you're making is that you're a shortsighted idiot with little real comprehension of the impact of the things you do.
Re:Did anyone really stop using gifs? (Score:4, Informative)
> this is precisely what PNG-8 is for?
Dude, that's what I'm _saying_. Many people don't realize that, and thus save their images with a higher palette than is necessary, and then complain that PNG doesn't compress as well as GIF. Photoshop doesn't tell you that when you save your file - you have to check the colour depth and change yourself. These same people also don't seem to use the post-creation compression tools to get the real compression benefit that can be had with PNG.
> At least 30% of the website icons I create are smaller as GIFs.
Are you compressing your PNGs with pngout or pngcrush? (pngout usually works much better) What kind of colour depth are we talking here?
Re:Did anyone really stop using gifs? (Score:2)
Ahem. You mean "in virtually no cases will GIF result in a smaller filesize than the equivalent PNG". The one common case[1] where it does is for a 1x1 transparent image, but there are only two uses for that anyway:
Transparent images for spacing are a nasty hack, and CSS gives you much better control over positioning anyway, and web bugs are no great loss. So essential
Re:Did anyone really stop using gifs? (Score:5, Informative)
GIF may be indexed color, but since the animation extension is supposed to allow for multiple palettes that DO NOT overwrite the previous palette, as well as the ability to have each frame render a small piece of a larger picture with mostly transparent background, you can "draw" a true color GIF.
See gif-with-32697-colors.gif [ark42.com]
If your browser draws it right, it will look like this [ark42.com]
Note that the GIF is 180K and the PNG is 14K, but they are both truecolor.
Unfortunately, many non-animated programs will only display the first frame, so you only see the upper left corner, and some will improperly overwrite the palette of every frame with the current frame's palette, causing the image to pulse widely as it draws and end up in the wrong colors.
Re:Did anyone really stop using gifs? (Score:2, Informative)
Re:Did anyone really stop using gifs? (Score:2)
On Safari 1.2.2, it starts as a red splotch in the top right corner of a black field. Then the color surges down and to the right creating a smooth image much larger than 256 colors until the complete frame is covered. But this takes about 5+ seconds to complete and is plainly visible to the user.
When the finished picture is dragged to the desktop, it makes a .gif file set to open with the s
Re:Did anyone really stop using gifs? (Score:2)
Oh I never said it should done at all, just look at the difference in file sizes. Its just one of neat things you could do with GIF if you wanted, that PNG can't do. Not particularly useful though, no.
Re:Did anyone really stop using gifs? (Score:3, Informative)
Unisys (Score:2, Insightful)
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.
Au contraire... (Score:2)
IANAL, NDIPOOTN.
obligatory warning (Score:4, Funny)
Gif is only good for animation (Score:4, Insightful)
Re:Gif is only good for animation (Score:3, Insightful)
Re:Gif is only good for animation (Score:2)
Betamax did dominate the broadcast market where there are still many being used today. Sort of akin to DAT being used in professi
Re:Gif is only good for animation (Score:2, Informative)
You can display PNGs with full alpha transparency, both as backgrounds of a block element and inline with an image tag, without using any javascript, behaviors, or a second image.
The following CSS and html code shows how:
For background:
For inline:
Re:Gif is only good for animation (Score:2)
Re:Gif is only good for animation (Score:2)
But most of the time, you have no reason to use gif instead of png.
Most of the time, I need transparency in IE.
Re:Gif is only good for animation (Score:3, Informative)
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.
Ancient technology (Score:3)
Re:Ancient technology (Score:2)
Is there a reason why you wouldn't use PNG for photographs as well? Since it's a lossless format, and compresses really well, it sure beats JPEG.
~D
Re:Ancient technology (Score:2)
Re:Ancient technology (Score:2)
Re:Ancient technology (Score:5, Informative)
Full alpha...here's one script [alfter.us] that implements it, and you use it something like this (assuming that you've loaded the script somewhere further up in your page):
Re:Ancient technology (Score:2)
Very nice! (Score:2)
It used to rely on a very old gd lib for gif support.
What format war? (Score:2, Insightful)
Re:What format war? (Score:5, Informative)
Re:What format war? (Score:2)
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!
W3Schools is biased; try Google Zeitgeist (Score:2)
that IE5 and IE6 together account for just over 80% of the market [w3schools.com].
"The statistics above are extracted from W3Schools' log-files." The fact that 14.0 percent of W3Schools visitors run the Gecko engine doesn't mean that 14.0 percent of W3Schools visitors run the Gecko engine. Most people who visit W3Schools are involved with web development, and I speculate that web developers are more likely to use a web browser other than the one included with the most popular home PC operating system [microsoft.com] th
Re:What format war? (Score:2)
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
Answer to the inevitable PNG Slashbots (Score:5, Insightful)
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)
Re:Answer to the inevitable PNG Slashbots (Score:2, Insightful)
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.
Re:Answer to the inevitable PNG Slashbots (Score:2)
Ancient software? (Score:4, Informative)
IE displays PNG's properly, with transparency, and it's still non-lossy. IE only doesnt properly support the alpha channel of PNG's.
Re:Ancient software? (Score:2)
It doesn't support the partial transparency of the png alpha channel. But it does do the full-on full-off transparency gifs are capable of.
Re:Answer to the inevitable PNG Slashbots (Score:2)
Re:Answer to the inevitable PNG Slashbots (Score:3, Informative)
This is purely subjective, and FUD. On a modern CPU, with a modern graphics card, both GIF and PNG should take the same amount of time to "render." The process of rendering includes taking the data, decompressing it, and writing the pixels to the display device.
It's quite possible that some web browsers may have a very broken PNG rendering e
Are we sure (Score:2)
Digital Cams ? (Score:2)
Re:Digital Cams ? (Score:2)
Yep. You're wrong.
Re:Digital Cams ? (Score:2)
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)
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)
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
Re:Digital Cams ? (Score:2)
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)
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)
[There. That should earn me some karma if the recent Flash flame war is anything to go by.]
Ho Hum (Score:2)
screw gd, use imlib (Score:2, Informative)
Re:screw gd, use imlib (Score:2)
Re:IBM (Score:2)
Re:IBM (Score:5, Informative)
Since it's a duplicate patent and should never have been issued in the first place, IBM would be idiotic to let it get anywhere near a courtroom.
Re:IBM (Score:2)
No. Congress cannot make a law which retroactively re-activates an expired patent; the Constitution explicitly forbids them from doing so:
"ex post facto" is Latin for "after the fact". When a copyright or patent expires, the work goes into the public domain, making it legal for everyone to
Sonny Bono??? (Score:2)
Good idea. Maybe that keeps anyone else from making copies.
Re:PNG is still better (Score:2, Informative)
Re:Choosy moms choose GIF! (Score:2)
Re:Choosy moms choose GIF! (Score:2)
Re:Seeking legal advice (Score:4, Insightful)
It's YRO not because GIFs could violate your rights online, but because Unisys, the holder of a submarine patent on GIFs, could. That's one of the main reasons we switched to PNG. Now the patent expired, meaning our rights to use GIFs, without getting the pants sued off us, are back.
Please increase your clue level before posting. The article is correctly filed.
Re:nice (Score:2)
Re:nice (Score:2)
Re:Finally. (Score:2)
While it may be annoying to you, the entire point of a company patenting anything is the hope that it will become common so they can make money from it via licensing. There's no money to be had (and thus no point) in patenting anything that will have no use. Your annoyance level doesn't factor into it.
Fortunately for you, some people were sufficiently annoyed so as to invent other graphics formats (JPEG, PNG) th
Re:PNG and non-metric resolution? (Score:4, Informative)
See this portion [libpng.org] of the PNG spec. The image resolution is stored in the PNG file as an integer number of pixels per meter.
There are 39.3700787 inches in a meter. Thus, a 300 pixels-per-inch image is 11811.02361 pixels-per-meter. However, the PNG can only store an integer number of pixels per meter. Thus, 11811.02361 gets rounded to 11811.
Convert back to inches. What is 11811 / 39.3700787? Why, it's 299.9994 pixels-per-inch!
That's why 100 pixels per centimeter works perfectly. It's in metric.
Stop using this silly "inch" things, and your problem will vanish.