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

Re: editing gifs with Perl

by Flame (Deacon)
on Dec 18, 2002 at 14:49 UTC ( [id://220847]=note: print w/replies, xml ) Need Help??


in reply to editing gifs with Perl

Since the primary question has already been answered, I'll leave it at that, but I will mention that it is really not that wise to be using gif's too often anymore as recently the company that owns the GIF compression algorithm has started to assert its rights.

If all you want is an image with transparency (or you don't take advantage of the animation capability) then I suggest you look at the PNG format, which GD does support. PNG is very similar to GIF, but it uses a different compression algorithm and can't be animated (yet, I hear rumors that they are working on that...)

Well, there's my advice, take it or leave it, just be careful with those gifs, I doubt anyone here can conveniently afford a legal battle.

Update: Oh yeah, several other file types also use the same compression algorithm, there was a discussion about this not too long ago... anyone that knows where it was feel free to post it as a reply or /msg me and i'll update this post again...





My code doesn't have bugs, it just develops random features.

Flame ~ Lead Programmer: GMS | GMS

Replies are listed 'Best First'.
Re:^2 editing gifs with Perl
by rozallin (Curate) on Dec 18, 2002 at 21:25 UTC
    PNG is very similar to GIF, but it uses a different compression algorithm and can't be animated (yet, I hear rumors that they are working on that...)

    The PNG equivalent of Animated GIFs are MNGs (Multiple-image Network Graphics.) As implied by the name, MNG was based on the PNG format to handle animated graphics. In addition to sharing a number of PNG's best features, it offers the following animation features:

    • Object/sprite based animation
    • Much better compression than animated GIFs
    • Frame differencing support
    • Nested loops (useful for complex animations)
    But MNGs are currently still in development and very few programs support it as of yet (the only program that springs to my mind is Netscape 6).

    -- Rozallin J. Thompson
    The Webmistress who doesn't hesitate to use strict;

      Well that's useful to know, what about Mozilla?



      My code doesn't have bugs, it just develops random features.

      Flame ~ Lead Programmer: GMS | GMS

        According to libmng.com, the MNG format is only natively supported by Mozilla, Netscape 6 (or higher) and KDE Konqueror. There are plug-ins available for other browsers but I've never used these so I cannot say how effective they are, if they work at all.

        -- Rozallin J. Thompson
        The Webmistress who doesn't hesitate to use strict;

Re:x2 editing gifs with Perl
by grinder (Bishop) on Dec 18, 2002 at 17:07 UTC
    recently the company that owns the GIF compression algorithm has started to assert its rights.

    Heh! Well in that case they (Unisys) had better hurry and start suing people, because the clock is ticking and the patent is due to expire in six months (June 2003). Funny how things turn out, we were told to burn our GIFs and embrace PNG, and here we are in 2002, and GIFs are just as pervasive as ever. And now it seems that in six months time we won't even have to bother any more. I wonder how long it will take for the meme to die?

    Mind you, I like PNGs from an ethical point of view, but they suffer from a big flaw over GIFs: they are bigger. If you want all the functionality the specification has to offer they are indeed très cool, but if you just want to replace GIFs you're worse off in terms of space.

    Some more reading material on the GIF patent issue:



    print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'

      The Portable Network Graphics (or PNG) file format features lossless compression, alpha channels, gamma correction and two-dimensional interlacing. PNGs (generally) compress better than GIFs by 5 - 25%. PNG supports 48-bit truecolor and 16-bit grayscale. Just remember that using truecolor images come at a cost of greatly increased file size.

      Recommended reading: everything at the PNG Home Site.

        Unfortunately, PNGs are still not universally supported, and thus you run the risk that some users will not be able to see inline PNGs. And even the browsers that do support PNGs don't fully support all the nifty, useful features.

        Versions 4 and Up of the "Big Two" (except IE 4 for the Macintosh) can view PNG images but support for advanced features such as gamma correction and alpha transparency remain broken and buggy.

        -- Rozallin J. Thompson
        The Webmistress who doesn't hesitate to use strict;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://220847]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-16 23:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found