Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z - Internet FAQ Archives

JPEG image compression FAQ, part 1/2
Section - [3] When should I use JPEG, and when should I stick with GIF?

( Part1 - Part2 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Business Photos and Profiles ]

Top Document: JPEG image compression FAQ, part 1/2
Previous Document: [2] Why use JPEG?
Next Document: [4] How well does JPEG compress images?
See reader questions & answers on this topic! - Help others by sharing your knowledge
JPEG is *not* going to displace GIF entirely; for some types of images,
GIF is superior in image quality, file size, or both.  One of the first
things to learn about JPEG is which kinds of images to apply it to.

Generally speaking, JPEG is superior to GIF for storing full-color or
gray-scale images of "realistic" scenes; that means scanned photographs,
continuous-tone artwork, and similar material.  Any smooth variation in
color, such as occurs in highlighted or shaded areas, will be represented
more faithfully and in less space by JPEG than by GIF.

GIF does significantly better on images with only a few distinct colors,
such as line drawings and simple cartoons.  Not only is GIF lossless for
such images, but it often compresses them more than JPEG can.  For example,
large areas of pixels that are all *exactly* the same color are compressed
very efficiently indeed by GIF.  JPEG can't squeeze such data as much as GIF
does without introducing visible defects.  (One implication of this is that
large single-color borders are quite cheap in GIF files, while they are best
avoided in JPEG files.)

Computer-drawn images, such as ray-traced scenes, usually fall between
photographs and cartoons in terms of complexity.  The more complex and
subtly rendered the image, the more likely that JPEG will do well on it.
The same goes for semi-realistic artwork (fantasy drawings and such).
But icons that use only a few colors are handled better by GIF.

JPEG has a hard time with very sharp edges: a row of pure-black pixels
adjacent to a row of pure-white pixels, for example.  Sharp edges tend to
come out blurred unless you use a very high quality setting.  Edges this
sharp are rare in scanned photographs, but are fairly common in GIF files:
consider borders, overlaid text, etc.  The blurriness is particularly
objectionable with text that's only a few pixels high.  If you have a GIF
with a lot of small-size overlaid text, don't JPEG it.  (If you want to
attach descriptive text to a JPEG image, put it in as a comment rather than
trying to overlay it on the image.  Most recent JPEG software can deal with
textual comments in a JPEG file, although older viewers may just ignore the

Plain black-and-white (two level) images should never be converted to JPEG;
they violate all of the conditions given above.  You need at least about
16 gray levels before JPEG is useful for gray-scale images.  It should also
be noted that GIF is lossless for gray-scale images of up to 256 levels,
while JPEG is not.

If you have a large library of GIF images, you may want to save space by
converting the GIFs to JPEG.  This is trickier than it may seem --- even
when the GIFs contain photographic images, they are actually very poor
source material for JPEG, because the images have been color-reduced.
Non-photographic images should generally be left in GIF form.  Good-quality
photographic GIFs can often be converted with no visible quality loss, but
only if you know what you are doing and you take the time to work on each
image individually.  Otherwise you're likely to lose a lot of image quality
or waste a lot of disk space ... quite possibly both.  Read sections 8 and 9
if you want to convert GIFs to JPEG.

User Contributions:

Report this comment as inappropriate
Nov 11, 2018 @ 11:11 am
Artikel ini menjawab Pertanyaan yang Sering Diajukan tentang kompresi gambar JPEG.
Ini adalah bagian 1, yang meliputi pertanyaan umum dan jawaban tentang JPEG. Bagian 2
memberikan petunjuk khusus sistem dan rekomendasi program. Seperti biasa,
saran untuk peningkatan FAQ ini disambut baik.

Baru sejak versi 14 Maret 1999:
* Memperluas item 10 untuk mendiskusikan rotasi tanpa loss dan pemangkasan JPEG.

Artikel ini mencakup bagian-bagian berikut:

Pertanyaan dasar:

[1] Apa itu JPEG?
[2] Mengapa menggunakan JPEG?
[3] Kapan saya harus menggunakan JPEG, dan kapan saya harus tetap menggunakan GIF?
[4] Seberapa baik gambar kompresi JPEG?
[5] Pengaturan "kualitas" apa yang bagus untuk JPEG?
[6] Di mana saya bisa mendapatkan perangkat lunak JPEG?
[7] Bagaimana cara melihat gambar JPEG yang diposkan di Usenet?

Pertanyaan lanjutan lainnya:

[8] Apa itu kuantisasi warna?
[9] Apa beberapa aturan praktis untuk mengkonversi gambar GIF ke JPEG?
[10] Apakah kehilangan terakumulasi dengan kompresi / dekompresi berulang?
[11] Apa itu JPEG progresif?
[12] Dapatkah saya membuat JPEG transparan?
[13] Apakah tidak ada JPEG lossless?
[14] Mengapa semua argumen tentang format file?
[15] Bagaimana saya mengenali format file yang saya miliki, dan apa yang harus saya lakukan?
[16] Masalah kompatibilitas umum apa saja yang ada di sana?
[17] Bagaimana cara kerja JPEG?
[18] Bagaimana dengan pengkodean aritmatika?
[19] Mungkinkah FPU mempercepat JPEG? Bagaimana dengan chip DSP?
[20] Apakah tidak ada standar M-JPEG untuk film?
[21] Bagaimana jika saya membutuhkan lebih dari 8-bit presisi?
[22] Bagaimana program saya mengekstrak dimensi gambar dari file JPEG?


[23] Di mana saya bisa belajar tentang menggunakan gambar di World Wide Web?
[24] Di mana daftar FAQ diarsipkan?

Artikel ini dan rekannya diposting setiap 2 minggu. Jika Anda tidak dapat menemukannya
Bagian 2, Anda bisa mendapatkannya dari arsip di
(lihat "[24] Di mana daftar FAQ diarsipkan?"). Bagian 2 sangat sering berubah;
dapatkan salinan baru jika yang Anda baca berusia lebih dari beberapa bulan.

Comment about this article, ask questions, or add new information about this topic:


Top Document: JPEG image compression FAQ, part 1/2
Previous Document: [2] Why use JPEG?
Next Document: [4] How well does JPEG compress images?

Part1 - Part2 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:

Last Update March 27 2014 @ 02:11 PM