Web Hosting Forums

Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16

This is a discussion on Gif creation will be back in the Hosting Talk & Chit-chat forum
http://www.zend.com/zend/week/week142.php The Unisys patent on gif has expired "in the US the patent expired June 20th 2003," and there is already a patch out that ...

  1. #1
    Loyal Client
    Join Date
    Sep 2001
    Posts
    64

    Gif creation will be back

    http://www.zend.com/zend/week/week142.php

    The Unisys patent on gif has expired "in the US the patent expired June 20th 2003," and there is already a patch out that adds support for gif back into php.

  2. #2
    Loyal Client
    Join Date
    Sep 2001
    Location
    Wichita, KS
    Posts
    1,523
    I still think that .PNG is better

  3. #3
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,491
    Just curious but why is PING better? In my limited experience with
    GIF and PING they both make huge files sizes, which for me is
    unacceptable. I do have a few GIF images that I would like to
    convert to JPG but can't because I need the transparent background
    (I think that is the right term. The background blends with any web
    page color)

    If I change either to a JPG the file size is reduced by approximately
    2/3rds. Why would anyone want to bloat their web pages with files
    that are larger than they need to be, unless there is a special
    requirement?

    Just curious. Please Enlighten this illiterate old man.

    Thanks in advance for helping me understand a little more of the
    technical side of the web.

  4. #4
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,661
    More than you ever wanted to know about PNG:

    http://www.libpng.org/pub/png/png.html
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL 2010

  5. #5
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    Connie,

    You're right, the compression that's used in GIF tends to be less "tight" than JPEG compression, but there are some good reasons to use GIFs sometimes. Transparancy is one of them.

    JPEG compression is also very lossy--that is, it can get files small, but in order to do that it has to throw out bits of your files which, as I'm sure you know, causes distortion and bluriness. GIF compresses things differently, so you don't lose the quality of the image. GIF only supports a 256-color palette, however, so its no go for photorealistic images. For small images, such as "text" buttons, using GIF will ensure that all of your buttons look consistant--each image can compress differently when you use JPEG, so each image can look a little different. Granted, this isn't usually a big issue, but I've seen it happen once and a while.

    PNG has several advantages. It has lossless compression (similar to GIF) so that you don't loose quality when you compress the image. With lossless compression, the computer looks for repeted data and inserts pointers to where the data can be found. For example, take the word Mississippi, which has several repeted letters in it in it. With lossless compression, Mississippi might be represented by Miss(2-4)(2)p(9)(2), where the numbers in the parens represent the position in the original word where the first occurance of the pattern occurs. Think about many photos you have: how many have backgrounds that are pretty uniform? The uniformity means that at the raw data level there will likely be lots of repeted strings of bits that can be compressed. This is also how ZIP file compression works.

    PNG also supports alpha transparency. GIF only supports a single color transparency. In GIF you pick a color that you want to be transparent, and when the browser displays the image, it doesn't draw any pixels that are in that color. Alpha chanels are, essentially, empty spaces in the file. If you've ever tried to use a drop shadow or glow in a GIF, you know how hard it can be. Using alpha transparency makes things like this much easier.

    I haven't done much with PNG files on the web, mainly because browser support has been so poor for PNG files. That said, I know there is more that can be done with them, but I'm not familiar...

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  6. #6
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,661
    Originally posted by jason
    I haven't done much with PNG files on the web, mainly because browser support has been so poor for PNG files. That said, I know there is more that can be done with them, but I'm not familiar...

    --Jason
    The only thing I use PNG for are those cute little icons you see next to text links, like a microscopic pair of binoculars next to 'Search' or a smiling face next to 'Who's Online' or whatever. If they don't show in a browser, who cares, you know?

    The fact is, ppl always settle for the worst implementation of something. Examples of this would be listening to music on 33/45 RPM records instead 78 RPM (if you're old enough to remember them), or cassettes which were designed strictly for voice recordings originally. Reel-to-reel sounded great, even by today's standards, at 30"/sec. What did most ppl use? 3.75"/sec. All ppl care about is how much junk they can cram into the smallest amount of space. Lousy 8-bit, 256-color GIF's and lossy JPEG's are what ppl want 'cause they take up less room, not 'cause they are better.

    I guess I'm one of 'em...
    Last edited by Vin DSL; 06-23-2003 at 11:49 PM.
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL 2010

  7. #7
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,570
    Originally posted by clssam
    In my limited experience with GIF and PING they both make huge files sizes, which for me is unacceptable.
    Take a black 'n white schematic, like an organization diagram or electronics diagram. Make a GIF and a JPG out of it. View both. Compare file size.

    JPG is meant for photographic images (or the like). It creates nice small files of these them and the inherent (somewhat) fuzzy result of the method is hard to notice.

    GIF is meant for files with relatively few disctinct colors suchs as buttons, icons, smilies, schematical illustrations (with lines and text) and cartoons. It will render them crisp and clear: sharp edges, no fuzziness around text. Extra: transparancy, animation.

    PNG is / was meant to be the rights free advanced implementation of GIF: support for many colors (though that may indeed create large images) without the fuzzyness inherent to JPG and partially transparent colors (alpha channel = beyond the all-or-nothing transparancy of GIF).

    Some will argue that there's vector graphics for some of these uses now, but that is not (yet) widely supported, neither on the image creation side, nor AFAIK by browsers.
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  8. #8
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    Vector graphics were discussed in one of the seminars at the conference I was just at, and the bottom line is that no one uses them. None of the browsers support them, so you need a plug in, and everything you can do with vector graphics you can do in Flash. Since most users have the Flash plugin these days, why make them download something else?

    Unless the browser vendors build in intrinsic support for vector graphics, the technology will basically be dead in the water.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  9. #9
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,491
    Thanks to all for the explanations.


    However, I am still somewhat confused, or curious.


    Since GIF images are so compressible, and only work with 256 colors why
    are the files always larger than a JPG? At least that is my limited
    experience.

    I have changed several manufactures black and white drawings from GIF to JPG.
    There was no loss in quality but the file size was less for the JPG. I have
    changed several color pictures that the manufacture provided as a GIF file
    to JPG. No loss in quality and again the file size was smaller.

    I realize that when you need a transparent back ground, You have to use a
    GIF file. I also realize that my experience may not be typical. But, I can
    only comment based on what I know from experience, and my limited knowledge
    of Graphics ( which is very limited )

  10. #10
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    JPEG has tighter compression than GIF. With JPEG, you are throwing out data that's not needed. To a certain extent you can do this without a loss of quality because the bits you are getting rid of are pretty much invisible to the human eye. With GIF or PNG you are getting rid of some data, but you still need to keep a pointer to where a copy of that data exists. If you are compressing a 2 or 3 color line drawing, you'll have lots of repetition of bits in the file, so you'll likely have larger chunks that can be discarded. In photographs you have a lot of variation in color, so you get less packing that can occur.

    In a two color file, you would only need to keep about 16 bits (8 bits for each color used) of the image and use pointers that span many pixels of the image) to the rest of the file. In a photo you might be using the entire 256 color palette and because of subtle changes in color (unless you have your subject standing in front of a blue screen, you background will have many changes in color across the background) each of those pointers may only span one or two pixels. More pointers and more colors = less compression...

    The best advice to follow is "do what works for you." If your happy with the quality you get with JPEG, then use JPEG. If you need transparency, use GIF. And finally, if you wnat to be on the cutting edge and don't care how browsers will render your content (since each renders them differently), use PNG.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  11. #11
    the Windlord Gwaihir's Avatar
    Join Date
    Jun 2002
    Posts
    2,570
    GIFs are definately not always larger than JPG's. In the example I hinted at above I had a large organization diagram maintained by the owner in a program that stored it as several megabytes. I needed to take a snapshot with me on a floppy. The sysop tried to make a JPG out of it and got a very blurry file still metering over 2MB. I suggested a GIF, as it is very suitable for such a black 'n white schematic, and got a file size of about 250kB.

    The schematics you speak of where probably small to begin with? A relatively common error is to allways work with the 256 color maximum (simple software can't do any better). This makes small GIF files relatively large because they start with a table listing 256 colors and specifiy each color as one of the 256 (takes 8 bits).

    I've worked a lot with images since, both for web and for quality print. What gives the best results depends on your image and your software (and settings). Don't worry about it too much: web use isn't critical towards image quality at all.

    BTW: casting a jpg into a gif of similar size or vice versa isn't a fair test, as each format is presented with the downsides left in the image by the other (jpg to gif will give very poor size results, gif to jpg lead to unecessarily low image quality for photographic images). Better to start with a high quality original and than compare the compressed and resized results.
    Regards,

    Wim Heemskerk
    ---
    Visit MeCCG.net - Cardgaming in J.R.R. Tolkien's Middle-earth
    And Gwaihir.net - The Middle-earth CCG store

  12. #12
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,491
    Jason and Wim

    Thanks again. As always I find your answers to be helpful. Keep
    in mind I don't understand most of the technical stuff. I'm still
    struggling with correct HTML and CSS. I can only ask questions based
    on my limited understanding. I will probably never understand all this
    graphics stuff because that is not a major interest in my life at the age
    of 59. However I am interested in gaining a general understanding of
    some things.

    My interest here is that there are three GIF graphics on our home
    page that I would like to resize. Byte size and actual size ( width height )

    When I resize the images they loose quality. The images have to be GIF for
    the transparent background. Any suggestions would be appreciated.

  13. #13
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    Connie,

    When it comes to image manipulation, there are two basic rules to keep in mind:
    1. Always work from your original (uncompressed) images.
    2. Its easier to shrink an image than it is to enlarge it.

    Since you are working with images that are already on your site, they already suffer from the effects of compression. Since these images are GIF's, compression issues are less sever than with JPEG, but it can still come into play. You didn't indicate if you are upsizing or downsizing, but I'm kinda guessing its upsizing.

    When you resize an image, the image has to be resampled. When you compress an image with JPEG compression you are also resampling it. When you downsize, the graphics program takes bits out of the photo to make it fit into the space you specify. The process is identical to JPEG compression. When you upsize the image you are stretching the pixels of the first image out. What was one pixel may become 16 (4x4), for example. There is a considerable difference between a 1x1 square and a 4x4 square! The algorithms that graphics software use aren't quite this cut and dry--they try to blend colors to prevent your image from looking pixelated--but that's the gist of it. Long story short, when you stretch an image you lose quality FAST!

    If you have any experience with photography, especially B&W photography, you know how images tend to get grainy as you blow them up. Traditional photography doesn't work in pixels, but the idea is the same--there is only so large you can go before you stop getting a good looking image.

    When I start working on images that I'm going to use on the web, I start at 300 dpi resolution and, depending on what I'm doing, I may also make it proportionally larger in length and width as well. (If you don't know, dpi stnads for dots per inch. It is a in webspeak a more appropriate term would be ppi or pixels per inch, but dpi is a caryover from the printing workd that has made its way into the web vernacular.) I usually work in Photoshop, so once I get something that I'm happy with, I save it in Photoshop's native PSD format. Then I resize it to 72 dpi and my needed measurements and save it in my final format--JPG, GIF, etc. Later, if I need to rework a color, increase the size, or do something else to that image, I open up the PSD, make my changes, and save it to my final size once again. If I need something larger than the size of my original, being at 300 dpi gives me some added flexibility. I can resize the image to what I need without resampling it. That lets me enlarge the image, but instead of stretching the pixels, Photoshop drops the resolution. So the image after the resize may be only 200 dpi (still much more than I need for the web), but it will have the exact quality of the original 300 dpi version.

    I know this doesn't help in your problem, but maybe it can help you in the future. There really is no easy way to fsolve your problem, unfortunately, other than remaking the image from scratch.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  14. #14
    Old Hillbilly Connie's Avatar
    Join Date
    Sep 2001
    Location
    Hills of Missouri
    Posts
    2,491
    Jason,

    You have the patience of Job

    The only thing I know about photography is what little I have
    learned working with graphics for my web site. I think part of
    my confusion comes from what I read in early 2000 that GIFs were
    best for web graphics. Smaller file size, faster download ect.

    Then by accident, I discovered that the type of graphics we were
    using were better displayed in JPEG format and they had a smaller
    file size.

    My interest in this thread was originally that the patent on gif
    has expired. My reaction was so what. However I have learned
    a few things as a result of this thread.

    I learned a long time ago that you can't successfully enlarge a
    graphic. I under stood why.

    Your comment about working with original files explains a lot.
    99% of the graphics I work with are not original. I have noticed
    even with JPEG images when I make a Thumbnail sometimes the
    image looses quality. I always wandered why, but your last post
    has explained that.

    Thanks for your patience. Thanks for all your help here and in
    other areas.

  15. #15
    Just Walking...
    Join Date
    Oct 2002
    Location
    England
    Posts
    431
    Clssam if you want to resize a gif always convert it to 16 Million colours in your editing software before resizing it, this will then give you the best results (when its saved it will automatically be reduced to 256 colours). Enlarging a gif is always harder than reducing it as the software has to guess at the missing information.

Page 1 of 2 1 2 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •