Sunday 30 January 2011

Digital Artifacts - are they still around?

Well, first we have to address the 'artifact/artefact' debate. It seems that initially in the UK we accepted both forms of spelling to mean made by man, but then when it was transposed to the digital domain it meant the errors that cropped up in digital production of image and sound. But in the US they preferred the spelling artifact. Now digital artefacts owe more to the archiving or production of digital items made by people while digital artifacts appear to still denote the errors in digitising or processing! That's our interpretation - any comeback? (We've seen the same with program and programme, which now have different meanings.) So, can you pass the test below? Would you be able to identify digital artifacts if you saw them? Can you visualise or hear the errors below?

Image file possible errors: Staircasing (aka jaggies), Blocking, Posterisation, Incorrect colour/gamma
Movie file possible errors: Smearing, Pulsing, Low contrast
Sound file possible errors: Whistling, Quantisation noise, Burbling

Not an exhaustive list but at the end we'll have a quick run through the list with effect and possible cause These are only some of the artifacts around and as the inherent quality of digitisation improves – eg more bits for audio and higher definition for video, with better compression algorithms and more bandwidth available for the result, the errors are getting less noticeable.

Rather than generating your own errors in production now, because they are better understood and catered for than they used to be, you're likely to run into problems with files that your clients give you and insist they have integrated into their digital project. They may be 'left over' from the previous version of the web site. Did you build in leeway on time and money for any consequences arising from difficulties with the content provided by your clients? Andy's golden rule is always to get the highest quality original but sometimes it just doesn't exist. It isn't only getting copy from them that can prove difficult. More food for thought!

And so to the results ...
Staircasing
Diagonal lines don't look smooth, rather they seem to go up or down in steps. This is usually caused by inadequate resolution and/or antialiasing of the image. Often it's that there are not enough pixels to exactly represent the line and appropriate blending of the edges of line with the background has not been done to compensate.
Blocking
Areas of the image that should show smooth and gradual changes in tone and colour break up into square blocks of pixels. This is usually caused by trying to compress the picture (eg with JPEG or MPEG) too much.
Posterisation
What should be smoothly varying areas in the image actually look as if they have contours, like a map. This is because the difference between the adjacent areas of colour is enough for us to see. This is a problem compounded by our ability to detect the edges between the different colours very well. This used to be a big problem with 8-bit colour images but is less so with full colour ones, but it can still occur, especially if any processing of the image has reduced the tonal range. The answer is to diffuse the boundary with noise, a technique called dither. This is a reason why noise in an image can sometimes be helpful.
Incorrect colour/gamma
The image you see in Photoshop looks different to the one in your browser. The probable reason is that the colour profile information in the image is missing or incorrect. It's also possible that the browser doesn't obey it. (If in doubt use sRGB colour space.)
Smearing in a movie
What I mean by this is that when the camera pans across something like a grass field and then stops panning, the smeary texture of the grass suddenly clicks into shape and you can see the blades of grass. Although MPEG compression of video has a mechanism to allow for movement in the image it does have limitations. Basically, more bandwidth or a better codec are needed. This effect can be made worse by some LCD screens.
Pulsing
In a static scene the background seems to have slight pulse to it. Early MPEG encoders could suffer from this but it is much less common now. The usual cure is to adjust the space between the I-frames and many codecs will do this automatically for you.
Low contrast
With professional video that is re-encoded for the web you sometimes think the image has the contrast turned down. This may be because the codec used to produce your web version 'did not know' that black and white are not at zero and 255 in professional video. Your codec should allow you to adjust the black and white points to fix this.
Whistling sounds in an audio file
This is an aliasing problem. The original digitising of the audio failed to filter out high frequencies that were beyond the bandwidth of the sample rate chosen, this usually results in a whistling noise that comes and goes with the sound. Sometimes an inaudible high-pitched tone can mysteriously appear at a lower frequency in the digitised file as a result. You may be able to filter this out but usually you should go back and re-digitise.
Quantisation noise
Normally background noise in an audio file is a constant hiss but occasionally you can hear a cracking or hissing noise that seems attached to the sound and only appears underneath it. This will probably be noise caused because the number of bits in the digitisation is not enough to represent the sound. While this used to be a serious problem with 8-bit audio is is hardly a problem with 16 and more bits. However, it can occur with quiet sounds and some codecs will introduce noise into the process to hide this: dither again.
Burbling
You'll notice this mostly on music, where a long musical note seems to have a regular burble in it. This means that at some point in the process the sample rate of the audio has not been set correctly and the playback is compensating by adding or dropping bits. I hear this a lot on low-bandwidth digital TV channels.
Some places to see more information:
  • DP Review has a good technical glossary covering these and other still image issues.
  • An EE Times paper called Solving digital image artifacts with advanced video processing by Phuc-Tue Le Dinh and Jacques Patry is five years old and somewhat technical but covers video and is still current.
  • That Dither Thing is a paper by Werner Ogiers that is again technical but includes a dramatic demonstration of how dither can 'rescue' a 4-bit audio file.