Sunday, August 16, 2009

Lossy vs. lossless

4:39 PM / Blu-ray / Comments9 Comments

Blu-ray

Note: This post was partly inspired by a discussion at the AV Science Forum. To view the original conversation and "test", take a gander here.

One issue that rears its head again and again with regard to the posting of screen captures from Blu-ray Discs is the use of a compressed file format such as JPEG as opposed to an uncompressed format such as .BMP or a compressed but lossless format like PNG. I've been posting full resolution screen captures for some time now, and, like a number of other sites doing the same thing, have always used JPEGs. As a result, the reliability of such captures have been called into question on occasions.

This is not unreasonable. I lean towards scepticism in many aspects of life, so the notion that people would be wary of trusting compressed images to tell the whole story is one I can fully understand. However, I thought I'd take a little time to explain why I use compressed images, and more importantly why I believe the images I post are an accurate reflection of the source material, and are not adversely affected by the aforementioned compression.

Fundamentally, the issue is one of space and bandwidth. A PNG image with a resolution of 1920x1080 can have a size of upwards of 3.5 MB, depending on the complexity of the image. (An uncompressed bitmap image with the same resolution will always occupy 5.93 MB in 24-bit colour.) A JPEG, saved with minimal compression (a value of "12" in Adobe Photoshop), takes up considerably less space, ranging in my experience from around 500 KB to around 1.4 MB. My web host provides me with 10 GB of disk space and a monthly bandwidth limit of 100 GB, which sounds like a lot but in reality is quickly eaten up by having vast numbers of large images stored and repeatedly accessed, particularly when you take into account leeching. Storing all my images as PNGs simply isn't feasible. I can either use compression or post substantially fewer images. (The possibility of hosting my images on free image sharing services like Photobucket has been suggested to me. However, in my experience these are always considerably slower than my host, which would only frustrate those viewing the images.)

Unlike some sites that I could but won't mention, it has always been my policy to use minimal compression. As stated above, this means saving my JPEGs in Photoshop with a "quality" setting of "12". Time and again, my experience has been that this results in no noticeable degradation of even the most complex images. Zoom in to 3,200% or something equally ludicrous, and you may start to see the odd individual pixel being slightly displaced. In real world terms, this is nothing. Such differences aren't visible at 100%, or even 200% or indeed 600% size, and therefore in my opinion have absolutely no bearing on the purpose of these captures, which is to provide as close as possible to an accurate impression of what a transfer looks like without actually viewing it in motion.* It's entirely true to say that they are not a carbon copy of the original frame down to the individual pixel. However, I contend that such differences are, from our point of view, essentially meaningless. We're not looking at these still frames under microscopes... and if we are, we should probably get out more.

At the suggestion of FoxyMulder (who posts on both AVS and Land of Whimsy), I devised a little test, posting two copies of the same capture of the same frame from the same film. Both are PNGs. However, one was first saved as a compressed JPG (quality of "12" in Photoshop), then saved again as a PNG. I've provided three examples below. In each case, one was saved lossily and the other wasn't. Can anyone tell me, without cheating (if you don't know how I'm not going to tell you), which is which?

 
#1. Monsters, Inc.

Monsters, Inc.
Image 1 / Image 2

 
#2. Franklyn

Franklyn
Image 1 / Image 2

 
#3. The Dark Knight

The Dark Knight
Image 1 / Image 2

Post your answers by Tuesday and I'll post the correct answers, along with how many people were right.

* I've said it before and I'll say it again: there's no substitute for actually viewing a disc for yourself. You can tell a lot from screen captures, but unfortunately they don't and never will be conclusive. For one thing, while they display the grain structure of an individual frame, they don't show its cumulative effect in motion, which can create quite a different look.

 
9 Comments

High quality JPEG is completely fine for comparing images from compressed video. Especially if the frame being examined is inter-frame (P or B frame).

(Posted on Sunday, August 16, 2009 at 6:48 PM)

2. Kram Sacul said:

As long as it's visually transparent to the original frame and compressed using the highest quality setting it's all good.

(Posted on Monday, August 17, 2009 at 12:24 AM)

3. Erik said:

Thanks for addressing this issue, Michael, I may just link up this entry and call it "Why JPEG?" somewhere on my site, as people continually bring up the PNG vs. JPEG thing.

No one's guessing? Without having zoomed in or scrutinized the images, I'm going to say... MONSTERS, INC. -- image 1 is the JPEG. FRANKLYN -- image 1 is the JPEG. THE DARK KNIGHT -- image 2 is the JPEG. I'm sure it's the other way around. :)

(Posted on Monday, August 17, 2009 at 1:10 AM)

4. Author Profile Page Michael said:

Erik:

By all means link to this post. I don't think it's rocket science, but hopefully it makes its point reasonably clearly and will clear up some of the confusion surrounding the accuracy of JPG captures.

(Posted on Monday, August 17, 2009 at 10:21 AM)

5. Dom said:

a quick guess, viewing them in browser only, I'd say the JPEGs were image1, image2, image1 ?

(Posted on Monday, August 17, 2009 at 10:44 AM)

6. Dom said:

btw, as a positive for JPEG over PNG, I don't think web browsers currently support embedded colour profiles in PNG files (whereas some do in JPEG files [1]), so you may actually find that posting a JPEG with embedded profile will provide the best possible experience for people running a decent browser [1]

[1] http://diglloyd.com/diglloyd/free/WebBrowserColor/index.html

(Posted on Monday, August 17, 2009 at 10:52 AM)

7. Author Profile Page Bingo said:

I'd say:

#1. 1 lossy, 2 lossless.
#2. 2 lossy, 1 lossless.
#3. 1 lossy, 2 lossless.

(Posted on Monday, August 17, 2009 at 6:20 PM)

8. poster said:

It's too late for me to try and guess now, and I don't care much, as I agree with your premise to begin with (highest quality JPEG is enough to showcase any problems of video compression).

However, you say that TDK screens are identical, and both saved as PNG, but when I zoom both in Photoshop, there's small differences between them all over the place. Really small, but I don't think there should be any at all. What gives?

(Posted on Sunday, August 23, 2009 at 7:58 AM)

9. Author Profile Page Michael said:

Poster:

What you say about the Dark Knight screens is very weird, as neither of them was at any point saved lossily. When I zoom into them at the maximum size (3,200%) in Photoshop, placing them each on a separate layer and flicking between them, I can't see a single difference. Are you using some sort of scaling algorithm? If so, that might account for discrepancies.

(Posted on Sunday, August 23, 2009 at 12:06 PM)

 
To combat spam, commenting is automatically disabled on entries older than 30 days.

Did a comment you tried to post accidentally get eaten by the spam filter? It happens from time to time. I get upwards of 200 spam comments every day and unfortunatley don't have the time to weed through all of them in case something genuine ended up there by mistake. If one of your posts gets incorrectly flagged as spam, email me at whiggles[at]ntlworld[dot]com and I'll do my best to retrieve it.