O uporabi .gif, .jpg in .png fajl-formatov

Tokrat pa o uporabi .gif, .jpg in .png fajl-formatov, v smislu kdaj konkretno (glede na tip image-a) je najbolj smiselno katerega od njih uporabiti (glede na velikost fajla, glede na kvaliteto itd.), npr. pri postanju screenshotov na spletnih forumih. Objava pa se nanaša na “Is there an ‘ultimate rule’ regarding gif/jpg/png sizes?!“: http://episteme.arstechnica.com/…/593007648831 diskusijo, ki sem jo par dni nazaj odprl na Ars forumu. Aja in pa mogoče še tale opomba: to je še ena v vrsti recimo temu “izrednih” objav, namreč, že skoraj v celoti imam napisane (poleg tistih treh o konfiguriranju/pohitritvi Windows-ov, o mojem RAM disku, in o premikanju “Documents and Settings” direktorija) še tri dodatne objave. Ena je o preventivnem ukrepu za preprečitev sesutja oz. korupcije trdega diska, druga o mojem odnosu do dela na splošno in tretja o mojih sekiranjih za popolnoma nepomembne reči.

Da pa vam ne bo treba odpirati tiste strani (diskusije na Ars forumu), vam tule spodaj ponujam v branje moj prvi/uvodni post v omenjeni diskusiji. Naj pa vseeno omenim, da sem o tej stvari premišljeval že kar nekaj časa, preden sem se o njej odločil povprašati “eksperte” na tem forumu.

I know that the title doesn’t reveal much about the thread’s topic, so here goes the longer explanation of it: you see, I am interested in an “ultimate rule” regarding the file-sizes of gifs, jpgs, and pngs in terms of a picture/graphic type (i.e. what’s displayed in it), while mainly I am curious about screenshots of desktop/programs and other such computing-related pictures …

Because you see, it happens too many times that I make a screenshots of some program’s UI or a dialog/menu etc. (btw. I have IrfanView set to save “captures”, as it calls them, with .gif extension by default), then for instance cut (”Cut – selection” feature) some particular part of out it and paste it in an empty window (and of course save it afterwards) only so that I need to open this new file yet two more times, and try saving it also in .jpg and .png so that I finally find out which “variant” has the smallest file-size. Of course it’s quite similar with various photos that I edit (i.e. cut selections etc.) and so on.

So again my question is basically: is there any general rule as to what type of picture is best for (saving it in) a particular extension??!

P.S. – Although I already noticed that for example for screenshots of programs’ UIs etc. (as mentioned above), the file-size is usually smaller if saved in .png format.

Thanks in advance, shirker

Sledijo pa najbolj relevantni odgovori. Najprej je tu kratek in jedrnat odgovor od uporabnika z nickom Magus`, ki je napisal sledeče: “large solid blocks of color = PNG can optimize nicely” in “lots of variation, for instance in photographs = JPG tends to optimize better“. Potem je tu še tudi zelo kratek/jedrnat post od uporabnika bash666-a, ki je napisal tole: “Continuous color regions: JPG“, “Monotone color regions: PNG” in “GIF never for static images.“.

Za konec pa še celoten malo daljši post/odgovor od uporabnika z nickom Marek, ki pa je na moje vprašanje odgovoril takole.

There’s no real rule. JPEG in most cases can get things much smaller than GIF or PNG, just with an associated loss in quality. There are reasons to use different image formats, but file size is only one factor.

GIF is good when you have simple graphics, due to the GIF’s palette limitations. It’s preferable to JPEG for screenshots because it doesn’t exhibit compression artifacts.

JPEG is better for anything complex, like photos, because it doesn’t have the same palette limitations as GIF, and compression artifacts are less visible in complex images.

PNG is lossless like GIF, but does not have palette limitations, so it is suitable for photos as well as simpler images typical of GIFs. Plus, it is unencumbered by patents. There is little reason to use GIF now that PNG is around, aside from lingering software compatibility issues.

To ask whether using JPEG will give you a smaller size file than PNG for the same image is, by itself, a meaningless question. PNG will always be the same size for a given image, but JPEG has compression settings, so a JPEG file of a given images can be any variety of sizes.

Vam pa priporočam tudi ogled diskusije “Why do people insist on using JPEG on text?“: http://episteme.arstechnica.com/…/967004993631, katero je na istem forumu kot zgoraj odprl uporabnik z nickom stickboy.

P.S. – Mislim pa, da najbrž ni potrebno posebej poudarjati, da se to še posebej tiče webdizajna (torej izboranja formata za slike na svoji spletni strani oz. blogu); ne gre namreč samo za skrb za dial-up uporabnike, gre skratka tudi za bolj smotrno izbiro formata vobče (pri čemer seveda tudi “skrbiš” za malenskost manjšo zasedenost trdega diska na serverju) in pa za princip, kot je lepo napisal eden od uporabnikov v diskusiji linkani tule nad tem odstavkom, ko se je pritoževal nad folkom, ki misli takole: “using larger files that look worse is perfectly acceptable, compared to smaller files that look better“, s čimer se jasno popolnoma strinjam!!

Tadej

2 Responses to “O uporabi .gif, .jpg in .png fajl-formatov”

  1. tadej says:

    Oho lepo, kot naročeno sem včeraj odkril tole objavo (in vam jo toplo priporočam) na Davorinovem blogu na “Embrio” portalu, direktno povezano s temo te moje objave zgoraj.

    Tadej

  2. [...] sem napovedal že v tejle objavi (in še v marsikateri drugi), bom danes pisal o raznoraznih mojih znanjih, s katerimi bi lahko kaj [...]

Leave a Reply