STEIM Workshop: A Vernacular of File Formats

30
A Vernacular of File Formats

description

Workshop I gave two weeks ago at STEIMhttp://www.steim.org/steim/events.php?event=424&year_archive=&type=2

Transcript of STEIM Workshop: A Vernacular of File Formats

Page 1: STEIM Workshop: A Vernacular of File Formats

A Vernacularof

File Formats

Page 2: STEIM Workshop: A Vernacular of File Formats

Image glitching:Imagebending (reversible) vs databending (irreversible)

Define Your Terms(or: Kanye West Fucked Up My Show)

Page 3: STEIM Workshop: A Vernacular of File Formats

8bits = 1byteA binary file = a sequence of bytes.

a binary file often also contains formatting information.compiled it can for instance form a program, or any other kind of file format.

A hex editor (0xED) can be used to view file data as a sequence of hexadecimal (or decimal, binary or ASCII character) values

for corresponding bytes of a binary file.

If a binary file is opened in a text editor, each group of eight bits will typically be translated as a single character, and you will see a (probably unintelligible) display of

textual characters.

If the file is opened in some other application, that application will have its own use for each byte: maybe the application will treat each byte as a number and output a stream of numbers between 0 and 255 — or maybe interpret the numbers in the

bytes as colors and display the corresponding picture.

Define Your Terms(or: Kanye West Fucked Up My Show)

Page 4: STEIM Workshop: A Vernacular of File Formats

Lossless data compression is a class of data compression algorithms that allows the exact original data to be reconstructed from the compressed data.

"lossy" compression is a data encoding method which compresses data by discarding (losing) some of it.

Define Your Terms(or: Kanye West Fucked Up My Show)

Page 5: STEIM Workshop: A Vernacular of File Formats

A raster image ( vs. vector images and stereo images) is a data structure generally represented by a rectangular grid of pixels (or a bitmap).

Technically, a bitmap is characterized by a certain amount of pixels defining the images width and height AND the amount of bits per pixel that defines the images

color depth.

Gamut: the possible different color representations.

When an image has a relatively low color depth, the stored color value is typically a number represented within an index of a color map or palette.

Define Your Terms(or: Kanye West Fucked Up My Show)

Page 6: STEIM Workshop: A Vernacular of File Formats

Header: the data placed at the beginning of a block of data (in this case the image) being stored or transmitted.

interleaved vs non-interleavedThe interleaved raw format stores its RGB data

rgbrgbrgbrgbrgbrgbrgbrgbrgb

A planar (non-interleaved) format stores its data:rrrrrrrrrgggggggggbbbbbbbbb

Photoshop RAWflat binary (header = 0)

Page 7: STEIM Workshop: A Vernacular of File Formats

Photoshop RAWflat binary (header = 0)

A channel is the grayscale image of the same size as a color image, made of just one of these primary colors. For instance, an image from a standard digital camera will have a red, green and blue channel. A grayscale image has just one channel.

Page 8: STEIM Workshop: A Vernacular of File Formats
Page 9: STEIM Workshop: A Vernacular of File Formats

Wordpad effect pietjepuk666 & Stallio:(open as unicode - mac os Roman) does at least two things to a binary file.

I've found that Wordpad does at least two things to a binary file; it replaces byte 07 (ascii: BEEP) with 20 - a space - , and it replaces every lonely 0A or 0D (line feed - end of line - and carriage return - new line of text - respectively) and also 0B (vertical tab) with the bytes "0D 0A". So the rate of glitching is probably dependent on how dark the picture is, since low bytes like these give dark pixels (i suppose).

in short: it adds one byte to the file.

BMP

BMP is an uncompressed file format.imagebending vs databending

Page 10: STEIM Workshop: A Vernacular of File Formats

BMP (16)

Page 11: STEIM Workshop: A Vernacular of File Formats

BMP (32)

Page 12: STEIM Workshop: A Vernacular of File Formats

GIF (1bit color depth)

Graphics Interchange Format is a bitmap image format that supports 8 bits per pixel and can thus consist of no more then 256 colors.

The format supports animation. Dither (the grainy blocky artifacts) is an intentionally applied form of noise used to “randomize quantization error”; the difference between the actual analog value and quantized digital value. This error is caused by truncation (the discarding of less

significant information).Dither thus helps to prevent from large-scale patterns such as "banding" (stepwise rendering of smooth gradations in brightness or hue). Moreover, the not available

colors are approximated because the human eye perceives the diffusion as a mixture of the colors. This creates the illusion of color depth.

Page 13: STEIM Workshop: A Vernacular of File Formats

GIF (1bit color depth, non-interlaced - 2f replaced for c0)

Page 14: STEIM Workshop: A Vernacular of File Formats

GIF (1bit color depth, interlaced)

The gif format uses a 4 pass one dimensional interlacing strategy. This means that one half of the image, consisting of every other row of pixels is rendered after the other half. In the image on the left this shows through a gradual displacement during weaving (the putting together of the two layers), which resulted in a second “ghost

image” (or combing artifacts with jagged edges).

Page 15: STEIM Workshop: A Vernacular of File Formats

GIF (8bit color depth, interlaced - 2f replaced for c0)

Page 16: STEIM Workshop: A Vernacular of File Formats

GIF (8bit color depth, interlaced - 2f replaced for c0)

Page 17: STEIM Workshop: A Vernacular of File Formats

PNG (8bit color depth, interlaced - 2f replaced for c0)

PNG is a bitmapped image format that employs lossless data compression and offers a 7-pass 2-dimensional interlacing scheme—the Adam7 algorithm.

This is more sophisticated than GIF's 1-dimensional, 4-pass scheme, and often allows for a clearer low-resolution image to be visible earlier in the transfer. This is visible in image 1 which just passed its first stage of the 7 part interlacing scheme. In this stage a part of the image is rendered almost flawless, while the further it

gets rendered, the more the corrupted data becomes visible.

Page 18: STEIM Workshop: A Vernacular of File Formats

PNG

(24 bits)

Page 19: STEIM Workshop: A Vernacular of File Formats

TARGA

The gif format uses a 4 pass one dimensional interlacing strategy. This means that one half of the image, consisting of every other row of pixels is rendered after the other half. In the image on the left this shows through a gradual displacement during weaving (the putting together of the two layers), which resulted in a second “ghost

image” (or combing artifacts with jagged edges).

Page 20: STEIM Workshop: A Vernacular of File Formats

TARGA(C replaced for F5)

Page 21: STEIM Workshop: A Vernacular of File Formats

TIFF(ZIP, Interleaved - m substituted for r)

Page 22: STEIM Workshop: A Vernacular of File Formats

PSD

Page 23: STEIM Workshop: A Vernacular of File Formats

A JPG compression consists of 6 subsequent steps:

1. Color space transformation2. Downsampling3. Block splitting4. Discrete cosine transform5. Quantization6. Entropy coding

1. Initially, images have to be transformed from the RGB color space to another color space (called Y′CbCr), that consists of three components that are handled separately; the Y (luma or brightness) and the Cb and Cr values (chroma or color values, which are divided into hue and saturation).

LOSSY: JPG

Page 24: STEIM Workshop: A Vernacular of File Formats

1. Initially, images have to be transformed from the RGB color space to another color space (called Y′CbCr), Here the Y refers to the luma or brightness and the Cb and Cr values stand for the chroma or color values for the blue and the red channel.

2. Because the human eye doesn’t perceives small differences within the Cb and Cr space very well, these elements are downsampled.

3. After the color space transformation, the image is split into tiles or macroblocks. Rectangular regions of the image that are transformed and encoded separately.

4. Next, a Discrete Cosine Transform (which works similar to the Fourier Transform function, exploited in datamoshing and macroblock studies) is used to create a frequency spectrum, to transform the 8×8 blocks to a combination of the 64 two-dimensional DCT basis functions or patterns (as differentiated by the red lines).

5. During the Quantization step, the highest brightness-frequency variations become a base line (or 0-value), while small positive and negative frequency differentiations get a value, which take many fewer bits to represent.

Page 25: STEIM Workshop: A Vernacular of File Formats

Because the RGB color values are described in such a complex algorithms, some random data replacement often results into dramatic discoloration and other effects.

The very high compression ratio of this jpg effects the quality of the image and the size of the artifacts.

When using quantization with block-based coding, as in these JPEG-compressed images, several types of often unwanted artifacts can appear, for instance ringing or ghosting. In the bend image to the left, the low quality and corruption have made these artifacts more apparent.

6. finally, entropy coding is applied. Entropy coding is a special form of lossless data compression that involves arranging the image components in a "zigzag" order. This allows the quantized coefficient table to be rewritten in a zigzag order to a sequence of frequencies. A run-length encoding (RLE) algorithm groups similar frequencies together and after that, via "Huffman coding" organizes what is left.

Page 26: STEIM Workshop: A Vernacular of File Formats

While sequential encoding (or baseline) encodes coefficients of a single block at a time (in a zigzag manner), progressive encoding encodes similar-positioned coefficients of all blocks in one go, followed by the next positioned coefficients of all blocks, and so on.

JPG (progressive)

Page 27: STEIM Workshop: A Vernacular of File Formats

JPG (Baseline standard)

Page 28: STEIM Workshop: A Vernacular of File Formats

JPG (baseline optimized)

Page 29: STEIM Workshop: A Vernacular of File Formats

The JPEG 2000 standard was mainly developed because of the many edge and blocking artifacts of the JPG format. JPEG 2000 has “improved scalability and edit-ability”. In JPG 2000, after the color transformation step, the image is split into so-called tiles, rectangular regions of the image that are transformed and encoded separately. Tiles can be any size, and it is also possible to consider the whole image as one single tile. This results into a collection of sub-bands which represent several approximation scales.

JPG 2000

Page 30: STEIM Workshop: A Vernacular of File Formats