Imaginative Recursions? On .JPEG Compression – and DCT (Discrete Cosine Transform) – Discrete Math Class

10 Apr

The question being…

” Describe an activity in terms of its iterative components, such as solving a Sudoku puzzle, a game of chess or backgammon.

Please mention any recursive elements that may occur…”

And the answer, of course…

Iterative Recursions?

Games?

Howzabout compressing Images?

– Enter Rasterization

Meaning, how do you think we’ve been shuffling, schlepping and otherwise compressing those beautifuls shots, first over a feeble 2,400 BPS Modem (took a while, BUT in most cases, it was worth the while!)

First JPEG’s (or .jpg’s as they’re commonly known) made a big hit back in the late nineties, allowing for higher definition images to be a part of a website – besides those cheesy .GIF’s which yes, could be animated, but once one wanted a bit more resolution and color, ended up becoming larger and larger files…

(and I tag this as a “Game” as I’m having a ball with a suite of about six apps, my “Pocket Photoshop” which I use to shoot, edit, composite, bubble and prep for my portfolio)

#Prismacolor Crayons? Look again!

#Prismacolor Crayons? Look again!

So what’s rasterization?

It’s a process whereby a grid is created, and yes, each single individual point (pixel) has a very unique identity; for a print image for example, values that include its Pantone Colorization, as to allow CMYK Color Separation, along with other types of metadata required for the downstream print equipment, like channels to allow for perfect outlines, “Alpha Channels” that allowed for literally split hairs to BE printed OR not, masks, etc, they were all layered in these .psd (Photoshop) files, which then had to be reconverted as .EPS (Encapsulated PostScript!… talk about MATH!)… so yes, how does one quickly shuffle a preview file?

“Typical usage

The JPEG compression algorithm is at its best on photographs and paintings of realistic scenes with smooth variations of tone and color. For web usage, where the amount of data used for an image is important, JPEG is very popular. JPEG/Exif is also the most common format saved by digital cameras.

On the other hand, JPEG may not be as well suited for line drawings and other textual or iconic graphics, where the sharp contrasts between adjacent pixels can cause noticeable artifacts. Such images may be better saved in a lossless graphics format such as TIFF, GIF, PNG, or a raw image format. The JPEG standard actually includes a lossless coding mode, but that mode is not supported in most products.

As the typical use of JPEG is a lossy compression method, which somewhat reduces the image fidelity, it should not be used in scenarios where the exact reproduction of the data is required (such as some scientific and medical imaging applications and certain technical image processing work).

JPEG is also not well suited to files that will undergo multiple edits, as some image quality will usually be lost each time the image is decompressed and recompressed, particularly if the image is cropped or shifted, or if encoding parameters are changed – see digital generation loss for details. To avoid this, an image that is being modified or may be modified in the future can be saved in a lossless format, with a copy exported as JPEG for distribution.

JPEG compression

JPEG uses a lossy form of compression based on the discrete cosine transform (DCT). This mathematical operation converts each frame/field of the video source from the spatial (2D) domain into the frequency domain (aka transform domain.) A perceptual model based loosely on the human psychovisual system discards high-frequency information, i.e. sharp transitions in intensity, and color hue. In the transform domain, the process of reducing information is called quantization. In laymen’s terms, quantization is a method for optimally reducing a large number scale (with different occurrences of each number) into a smaller one, and the transform-domain is a convenient representation of the image because the high-frequency coefficients, which contribute less to the over picture than other coefficients, are characteristically small-values with high compressibility. The quantized coefficients are then sequenced and losslessly packed into the output bitstream. Nearly all software implementations of JPEG permit user control over the compression-ratio (as well as other optional parameters), allowing the user to trade off picture-quality for smaller file size. In embedded applications (such as miniDV, which uses a similar DCT-compression scheme), the parameters are pre-selected and fixed for the application.” (Wiki, 2013)

So maybe I do not play games… but I’m sure many in the audience are staring at these, right now!

Source: http://en.wikipedia.org/wiki/JPEG

%d bloggers like this: