Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: JPEG Compression Comparison (Read 12514 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

JPEG Compression Comparison

I did a little test on JPEG encoders yesterday, wanna find out how much the maximum quality of each encoder differ from the originals. I used ionForge imageDiff in comparing output files with original files. I'll post result here just in case someone might interest.


These are lists of programs and options I used in creating JPEG file.

ADOBE Photoshop CS2: Quality = 12, Baseline Optimized, Non-progressive

XnView 1.80: Quality = 100, Optimize Huffman table, Non-progressive

Advanced JPEG Compressor 4.6: Non-progressive, True Color (24 bit), High Precision (2 Luma : 2 Chroma), Compression Level 1 (both Luma and Chroma)

LEADTOOLS Command Line File Converter: /F10 (Output format = Jpeg File Interchange Format), /Q2 (Quality factor, values are in the range 2-255)

IrfanView 3.85: Quality = 100

ACDSee 7.0 Build 62: Image Quality = 100, Optimize Huffman codes, Color component sampling 2:1 Horizontal 2:1 Vertical, Never add/update thumbnails

JPEG Wizard 2.4.0.6: Subsampling = Color 1/1/1 - Favor Quality, Initial overall quality setting = 1 (Lum 0, Chrom 0), Baseline

Jasc Paint Shop Pro 9.01: Encoding Type = Standard encoding, Compression Factor = 1, Chroma Subsampling = YCbCr 1x1 1x1 1x1 (None)

Corel Photo-Paint 12.0.0.458: Encoding Method = Optimize, Compression = 0, Smoothing = 0, Sub Format = Optional (4:4:4)

The Gimp 2.2.8: Quality = 100, Optimize, Smoothing = 0, Subsampling = 1x1,1x1,1x1, DTC method = Floating-Point

Sample 1



Sample 2


Sample 3



*sample 1 & 2 are original files that I used on the test. original sample 3 is too big to host at imageshack, so this is 50% JPEG version.


Results

Results show differences in percentage of both pixel and colour, lower is better.




Well, what I got from the test are

- Advanced JPEG Compressor 4.6 produces JPEG file with least differences.
- The best 3, IMO, are The Gimp, Advanced JPEG Compressor, and Corel Photo-Paint.
- XnView and IrfanView use the same JPEG encoder.
- ACDSee has poor JPEG encoder. On 3 samples, It produce lower quality output than XnView and IrfanView, also larger file size.

JPEG Compression Comparison

Reply #1
Quote
- XnView and IrfanView use the same JPEG encoder.


...which happens to be the infamous Independent JPEG Library. It is optimized for multiplatform-ness, but not for quality.

Quote
- ACDSee has poor JPEG encoder.[{POST_SNAPBACK}][/a]


Intel JPEG Library version 1.1.2. Extremely optimized JPEG routines - by far the fastest encoder and decoder - but of course, quality is overlooked in favour of speed.

I would be very interested in results from Pegasus' JPEG Wizard:

[a href="http://www.jpg.com/jpegwizard.htm]http://www.jpg.com/jpegwizard.htm[/url]

Pegasus has lots of experience in JPEG encoding.

JPEG Compression Comparison

Reply #2
This is result from Pegasus' JPEG Wizard.
Setting: Subsampling = Color 1/1/1 - Favor Quality, Initial overall quality setting = 1 (Lum 0, Chrom 0), Baseline




It produces largest file size but no improvement in quality. ADOBE and Advanced JPEG Compressor are better.

JPEG Compression Comparison

Reply #3
How about Paint Shop Pro?

I once did a (purely visual) comparison of PSP JPG output vs. IrfanView output at the same quality, and i could see tiny differences, but i couldn't decide which was better or worse. IrfanView's files were a bit smaller, though.

JPEG Compression Comparison

Reply #4
Very interesting test. What was the methodology (what programs & functions did you use to get the percentages)? And what's the difference between pixel & color (pixel always has a color )?

JPEG Compression Comparison

Reply #5
yes, very interesting, but i don't get the results.

JPEG Compression Comparison

Reply #6
I updated results. add more 3 programs; Gimp, Corel Photo-Paint, and Jasc Paint Shop Pro. The result of The Gimp surprise me. It's the best in 2 of 3 samples and it's a free software.

Quote
Very interesting test. What was the methodology (what programs & functions did you use to get the percentages)?
[{POST_SNAPBACK}][/a]

I used [a href="http://www.ionforge.com/products/imagediff/]ionForge imageDiff[/url] to detect the differences.

ImageDiff can be used to
- comparing an original lossless image to a compressed lossy version
- comparing different implementations of the same format
- comparing color profiles.
- comparing antialiasing algorithms to see which is smoother.
- detecting any subtle change.
(take from  the program's help file)

Quote
And what's the difference between pixel & color (pixel always has a color )?
[a href="index.php?act=findpost&pid=319918"][{POST_SNAPBACK}][/a]

Truely, I'm not really understand it neither.  Therefore, I'll ask this in ionforge's forum. To my understanding, this program just compares the difference of colour in each pixel and results in changed pixel percentage. (I test this by compare an original colour picture with a greyscale one. ImageDiff shows 100% difference in  pixel and 14.96% difference in colour  )

JPEG Compression Comparison

Reply #7
I think the test is kinda pointless, unless you compare the quality of same file size files. That would really say something about the quality of the encoder.

JPEG Compression Comparison

Reply #8
Quote
I think the test is kinda pointless, unless you compare the quality of same file size files. That would really say something about the quality of the encoder.
[a href="index.php?act=findpost&pid=320015"][{POST_SNAPBACK}][/a]

This is more like quality limitation test. It tells you what's the best you can get from each encoder.

JPEG Compression Comparison

Reply #9
Quote
Quote
I think the test is kinda pointless, unless you compare the quality of same file size files. That would really say something about the quality of the encoder.
[a href="index.php?act=findpost&pid=320015"][{POST_SNAPBACK}][/a]

This is more like quality limitation test. It tells you what's the best you can get from each encoder.
[a href="index.php?act=findpost&pid=320054"][{POST_SNAPBACK}][/a]

Well, yeah, but usually you use JPG to get small filesize with acceptable quality. If you're shooting for pure quality, you go with PNG.

JPEG Compression Comparison

Reply #10
Quote
- The best 3, IMO, are The Gimp, Advanced JPEG Compressor, and Corel Photo-Paint.[a href="index.php?act=findpost&pid=319767"][{POST_SNAPBACK}][/a]


I think that one is pretty much a no-brainer, looking at the produced file sizes.

That doesn't excuse PSP and Pegasus' lame performance, though...


JPEG Compression Comparison

Reply #12
Quote
Quote
- XnView and IrfanView use the same JPEG encoder.


...which happens to be the infamous Independent JPEG Library. It is optimized for multiplatform-ness, but not for quality.[{POST_SNAPBACK}][/a]


Quote
I updated results. add more 3 programs; Gimp, Corel Photo-Paint, and Jasc Paint Shop Pro. The result of The Gimp surprise me. It's the best in 2 of 3 samples and it's a free software.[a href="index.php?act=findpost&pid=319997"][{POST_SNAPBACK}][/a]


[a href="http://packages.debian.org/unstable/graphics/gimp]http://packages.debian.org/unstable/graphics/gimp[/url]
http://packages.debian.org/unstable/libs/libjpeg62

Gimp2 depends on libjpeg62, the Independent JPEG Group's JPEG runtime library.

JPEG Compression Comparison

Reply #13
Quote
Isn't this just like using spectrograms to judge sound quality of lossy codecs?
[a href="index.php?act=findpost&pid=320161"][{POST_SNAPBACK}][/a]

No, using spectrograms to judge sound quality of lossy codecs is like using headphones to judge quality of JPEG encoders


JPEG Compression Comparison

Reply #15
Well, yes, though JPEG doesn't have any psycho-visual model, so you can take it from calculation point of view more than you do with lossy audio codecs.

JPEG Compression Comparison

Reply #16
Quote
To my understanding, this program just compares the difference of colour in each pixel and results in changed pixel percentage. (I test this by compare an original colour picture with a greyscale one. ImageDiff shows 100% difference in  pixel and 14.96% difference in colour  )
[a href="index.php?act=findpost&pid=319997"][{POST_SNAPBACK}][/a]

When you compare all black picture with all white then you get both percentages 100%, so I guess you're right - pixel tells you how many pixels differ, and color tells you how much RGB values differ for given pixels.

JPEG Compression Comparison

Reply #17
If program A produces bigger file size  and more changed pixels than program B, can I say for sure that program A is worst than program B?

JPEG Compression Comparison

Reply #18
Quote
Well, yes, though JPEG doesn't have any psycho-visual model.
[a href="index.php?act=findpost&pid=320172"][{POST_SNAPBACK}][/a]


Define psychovisual model.

What do you think is the quantization matrix in JPEG for ?

maximizing PSNR != maximising visual perceived quality


Sebi

JPEG Compression Comparison

Reply #19
Quote
Well, yes, though JPEG doesn't have any psycho-visual model

MPEG audio doesn't have any psychoacoustic model either.
Those standards do not define encoding models, only decoding process.
Some mpeg audio encoders can use psychoacoustic models, and some jpeg encoders can use psychovisual models.

JPEG Compression Comparison

Reply #20
Waa.. I made a mistake. I used wrong setting with ACDSee. I chose 4:2:0 chroma subsampling which can degread output quality. I tested again without subsampling. Results are identical to Pegasus JPEG Wizard with slightly increasing filesize.

ACDSee 7.0 Build 62 (without chroma subsampling)
Sample 1: pixel = 51.43 colour = 0.12 filesize = 1,279,584 bytes
Sample 2: pixel = 41.31 colour = 0.16 filesize = 262,337 bytes
Sample 3: pixel = 90.84 colour = 0.32 filesize = 1,711,977 bytes

ACDSee may use same JPEG encoder as JPEG Wizard.

Furthermore, Corel Photo-Paint also use IJP's JPEG library.
With this command-line, you can create the same output as Photo-Paint.
cjpeg -quality 100 -optimize -dct int -sample 1x1 -outfile <outfile.jpg> <infile>

Additionally, someone at ionforge explained about the changed colour percentage.
Quote
To clarify, the changed colour percentage data is the amount of color change per pixel. So as an example, if you have a 10x10 pixel image that is completely black (0x000000), and compare it against a 10x10 white image (0xFFFFFF), the color change would be 100%.

However, what is being calculated is the total amount of color per pixel (128+128+0, max 255+255+255=765), divided by the total amount of color in the comparison image.

So if every pixel in our 10x10 image above is exact middle gray, and it is compared against a perfectly white image, the color difference would be 50%. If a single pixel is gray instead, the % color difference would be .5% (1% / 2).

I think most encoders give similar quality. Some programs produce better results because they give more encoding options. If someone looking for a good free JPEG encoder, IJP's could be a choice. (If ony it would support png input.)

JPEG Compression Comparison

Reply #21
It would be interesting to calculate the % variation per byte or kilobyte, to see which encoder has best efficiency... At least at high file sizes.

JPEG Compression Comparison

Reply #22
It would really not be that hard to devise a blind test for images. What I'd be afraid of is that no JPEG quality option would really be indistinguishable from the original. IIRC, the last time I looked at such things in the Gimp, every quality setting caused a visible degredation.

JPEG Compression Comparison

Reply #23
Quote
If program A produces bigger file size  and more changed pixels than program B, can I say for sure that program A is worst than program B?
[a href="index.php?act=findpost&pid=320178"][{POST_SNAPBACK}][/a]

For sure not. Just like you can imagine bigger lossy audio file to have more changed samples than smaller lossy file, but the bigger one still can sound more like the original.
I'd say that in this JPEG test the color percentage tells more about the quality than pixel percentage, it still would be good to see output images to be of more or less the same size.
Quote
Define psychovisual model.

What do you think is the quantization matrix in JPEG for ?
[a href="index.php?act=findpost&pid=320207"][{POST_SNAPBACK}][/a]

Well it can be called a simple psycho-visual model.
My definition would be: Psychovisual model - something more complex and serving more complex purposes than quantization matrix in JPEG encoders

JPEG Compression Comparison

Reply #24
Quote
Quote
- XnView and IrfanView use the same JPEG encoder.


...which happens to be the infamous Independent JPEG Library. It is optimized for multiplatform-ness, but not for quality.

[a href="index.php?act=findpost&pid=319774"][{POST_SNAPBACK}][/a]

The problem with them that I've ran into is their jpeg encoder isn't supported or is non-compliant with many hardware dvd players that can display jpeg images. Also there's a few other image editing programs that refuse to open *.jpg images saved by them. At least they do have the option to save at a higher quality vs. the likes of MS Paint.