Fringewood News   Mac Chat #5.02


MAC CHAT DIRECTORY

INDEX
 

 

Nubies' Corner

     One of the most confusing aspects of learning graphics on the Macintosh and other computer platforms is learning file formats. It is so easy to get the details wrong about each format, so, I'll try and explain a bit to see if I can clarify the issues here. This is a long article with a lot of basic information, so reading it in one sitting may not be the most advantageous.


     To understand computer graphics, one must understand the pixel. A pixel is a single square dot on the computer screen. Screen resolution, controlled in the Monitor Control Panel, is a messurement of the number of vertical and horizontal dots that fill the screen. This enlargement of a small portion of my screen at the time I wrote this article (below) shows the tiny squares that fill the screen. The resolutions available depend on the monitor and the video card in the processor. Each has its own set of resolutions of which it's capable. Common resolutions are 640 X 480, 800 X 600, 832 X 624, 1024 X 768, 1200 X 800 and on up. The first number is horizontal width, the latter vertical height, (standard ratio is 4 : 3) and they represent the number of dots that define the size of the bitmap displayed on the screen. All images can be sized by pixels, and when divided by image resolution (pixels per inch) determine the size that the image will print. Screen resolution is default at 72 pixels per inch, because it matches the font point system where 72 point is one inch high.

     Each square is comprised of three color values, one for red, one for green, and one for blue. The values are combined together to create a single value, which is called RGB (for red, green, blue). I'll cover this color theory in more detail in a later issue. In 8 bit color, there are two bits for red, two bits for green, and two bits for blue, the remaining two bits being for alpha, or transparency. In most cases where transparency is not a factor, it is actually 6 bit color. In 16 bit color, it has 4 bits for each color (12 bit color w/o transparency). In 32 bit color, it has 8 bits per color (24 bit color w/o transparency). Because the system always maintains transparency capabilities, even if they are not used, the values w/o transparency are never used when setting system color. These are only used in professional color applications to indicate that transparency is not a factor.


     Let me also state that the native format for Macintosh is PICT. If it exists within a Mac application interface, it is a PICT file. The native screenshot function produces a PICT file. It has dual identities in the first two categories and has no compression in its pure form, though it can be compressed using JPEG encoding, but then it become a JPEG format image.
     The Windows counterpoint to Mac's PICT is the BMP format, which has the same basic characteristics. But being Windows, it was designed to be different enough to be different from PICT, even though it is identical in every other way in terms of system function except possible compression to JPEG. Both of these formats may be saved in either 16 or 32 bit mode. Unless there is a specific need for 16 bit, the default mode should be 32 bit, as it is capable of smoother color.
     This stated, I'll go onto discuss formats.




     All told, there are over 200 recognized file formats for 2D image files, but many of them are so seldom used, that I will only discuss the most common. With knowledge of the most common, figuring out the lesser used formats will be easier. There are three main factors and a few more minor factors that determine the nature of a file format. Some files have more than one capability for each category, and they are consequently larger in size because of it.

1) Type (vector or raster)
2) Color encoding
3) Compression


     The file type is the most important in dealing with image files. The two types common to digital processing are vector and raster.
     Vector tends to be the smaller file because of the way it deals with images, and it is the more flexible in terms of image resizing. Vector is commonly called clip art when in PICT format on the Mac (BMP in Windows). Clip art also exists in EPS (Encapsulated Postscript) format for using with EPS compatible laser printers. Vector formats are created by filling paths within a window. The common shapes are rectangles(squares), ovals (circles), and polygons which can be user defined. Using a path tool can also create organic shapes. All the vector path tools have one thing in common, and that is shaping points, which show up as little squares (often in the corners) that allow the user to resize the image by pulling and pushing on them with the cursor. If the corner can be grabbed and enlarged, it is vector art. Images created in vector art come from piling these colored shapes atop one another. The reason that these files tend to be smaller than raster files is that it is defined by the coordinates of the points on the paths, and not a pixel by pixel definition.
     Raster images, often called "paint", are defined pixel by pixel using a bitmap. This bitmap is defined by the original size of the image when it was created, and resizing them can cause problems with image quality to which vector art is imune, because of the way that the bitmap must adapt to a new pixel matrix. It is important to get the size of a raster image right when first creating it, or it will invariably lose some of its sharpness as the original bitmap overlaps the new pixel boundaries unevenly, forcing an averaging of the pixel values when set into the new size. However, vector art can not represent photographic images, and this is the main area where raster is used. Most raster image files contains RGB values for each pixel in the image, though how each format does this varies in the color encoding methods, and this encoding process is one of the main reason there are so many different formats. However, the one forte for raster is the ability to alter the image mathematically, allowing for color correction, distortion, and the use of filters to change the basic nature of the bitmap.
     It is much easier to convert vector to raster than it is to convert raster to vector.


     Color encoding is the second most influential factor on image formats. RGB is the default screen mode, and many of the formats that are screen oriented use RGB.
     One variation of RGB is grayscale, where the red, green, and blue values for each pixel are equal. Grayscale is most often used in B/W photoscans or converting color images to B/W. The advantage of grayscale is that since the RGB values are equal, the value only needs to be listed once instead of three times, and this reduces file size to almost a third.
    CMYK is often called "four color printing" and is very similar to the red, blue, and yellow system used with pigment paint. However, this is not the same, and the paint process is solid and CMYK is dot printing, like that seen in newspapers and magazines. C is for cyan (blue green, close to aqua), M is for magenta (hot pink), Y is for yellow, K is for black (B is already taken by blue). These are subtractive primaries, and they come from mixing RGB light. Cyan is a mix of blue light and green light; magenta, red light and blue light; and yellow a mix of green light and red light. CMYK mode is used for ink printing and has no real purpose for screen display.
     There are other specific modes, such as Lab Color, Pantone (an RGB to CMYK ink selection system), but these are not involved in the common everyday computer formats. If you are using these, you already know the formats and are probably making money with them.
     This leaves us with color palettes. Color palettes are a set of RGB samples that are defined within the file, and instead of using the RGB value for each pixel, the much shorter position value in the matrix is used to define the colors. There are two primary forms of color palettes, being Indexed Color and CLUTs (Color Look-Up Table). The CLUT is almost always a resource within an application (video games use them very often) or animation file when more than one image or resulting frame must share the same color table. Indexed Color is the most commonly used color palette system in still image files. Indexed Color is the mode if a color table such as the one below is used to select the colors being used. The most common color table is called System Colors, and in 8 bit mode, it is used to operate the screen colors. Windows naturally has one that has slightly different color values.



Macintosh System Color Palette (AppleWorks)
 

     Compression is the final major issue in graphic file formats. Many formats that deal with exacting color do not compress the files, as such compression can result in color loss (values can change slightly to accomodate the compression.) The most common use of file compression is used when file size is more important than color quality, and the internet is the leading user of compressed image files.
     RGB compression, like that seen in JPEG files, is a matter of relating the degree of change from one pixel to the next, which is often much smaller than defining every pixel with full RGB values. This is why in JPEG files that have been compressed too much show "artifacts" or unsightly coloration where color changes values very quickly, such as a dark line on a bright background.
     Color Index files can also have compression. GIF files have a process called LZW where when a single color in a palette is used side by side in a long horizontal string (blank color background), the string is defined, and when ever it is encountered again, a much shorter alias is placed in the file, removing the need to repeat the same value many times. There are others as well, but most work on the same or similar process.
     Vector art has some modest compression, as in Flash format, but the savings there are far more geared toward reducing general file information than image information.


     So, with this all stated, here is a table of the ten most common 2D graphics formats and their basic characteristics and relative size. Note that there are other differences not mentioned here, such as tags, but more than already stating is pressing it for those not already familiar with graphic file formats.

Format

Type

Color Mode

Compression

Use

Relative Size

PICT (Mac)

Vector/Raster

RGB/Indexed Color

None

Mac system

Normal

BMP (Windows)

Vector/Raster

RGB

None

Windows system

Normal

JPEG (JFIF)

Raster

RGB

Variable, Lossy

Internet

Small

GIF

Raster

Indexed Color 8 bit

Possible

Internet

Small-Very Small

TIFF

Raster

CMYK/RGB/IC

None

Printing

Bloated

TARGA

Raster

RGB/CMYK

None

Video

Large-Bloated

FLASH

Vector

Indexed Color

By Format

Internet

Very Small

PNG

Vector/Raster

Indexed Color

Possible

Internet

Small

Photoshop

Raster (Vector-6)

RGB/CMYK/IC

None

Layers, Editing

Large

EPS (Clip Art)

Vector

Indexed Color

None

Laser Printing

Normal



     In closing, I want to add a few notes about some of the formats:

     JPEG format is actually JFIF format, but for some reason, the name of the organization that invented it (Joint Photographic Expert Group) stuck instead of the proper name. So the two are virtually interchangable.

     GIF and CompuserveGIF are the same thing. Compuserve invented the GIF, and in some places, they demand that their name be placed with the format. Unlike JPEG, Compuserve demands royalties of any application that can save a file to GIF format. GIF89a is the format for animated GIF's, and it varies in structure from still image GIF87 (the numbers indicate the year the format was released).

     Photoshop format is available only to Photoshop and a few associated applications from Adobe. They are very stingy about letting anyone else use their format in their applications. Then again, it is the Industry Standard for image transfer. Photoshop is capable of layers with transparency, which makes it ideal for image editing. Images can be laid atop other images and subtly blended together into a single image. Photoshop 6 format introduced limited vector capabilities to its previous raster only format.






Software

     Poser 4 (Mac/PC) by Curious Labs (formerly owned by Metacreations) is rapidly creating a community of designers who willingly share their creations with each other in order to make the design process easier and better for all. In many ways, it reminds me of the POV-Ray community in the willingness to share.

     In essence, Poser uses OBJ format 3D model files to generate the people, animals, and other characters and objects. However, it doesn't stop there as do most 3D modelers. Underlying the OBJ process are three more processes that give Poser its full capacity to render and animate posable figures.
     The first is the skeleton figure that is a separate file, and it defines where the bends and motions take place within the OBJ model. This is in 3D terms quite similar to the stick people all we drew as children. The bends are called joints, much as the joints in our skelton frame.
     The second is what is called morph targeting, and this is basically a mathematical equation applied to a specific region of the OBJ models in order to modify the splines of the mesh. In essence, this allows for reforming the model to reshape the features, such a longer or wider nose, heavier muscles, higher forehead, slimmer waist, etc. The morph targets are small meshes that replace the original portion of the model, along with the methematical formula for changing them. The control for changing the features appears as a dial to set the single variable in the methematical equation. A small box that shows the dial's value can also be changed by typing in a numerical value (more accurate if the value is already known).
     The third is texture mapping, which all models share. However, the texture maps are not the same as seen in many 3D modeling applications, but are very part oriented. In a human model, the eyes, tounge, eyebrows, fingernails, hands, feet, and so forth each have their own portion of the texture map, and they can be more easiliy changed individually. This does present its own problems in creating textures, but using Photoshop layers with the templates for the textures makes it easier to see what belongs where. Not only does the model have texture maps, but it also has bump maps (surface texture: rough, smooth, the pores in skin) that gives the surface tiny shadows that real textures have, reflection maps for shiny chrome and other similar effects, and transparency maps, which can make part of the model disappear. The latter is good for creating realistic hair, clothing fashion variations from basic clothes model (cut off jeans for example), and similar operations for removing. A model doesn't need any of the maps to be rendered if a flat tonality is sufficient for the rendering, but they can be used in any combination of the four that is desired.

     There are a number of other files that can be saved as native support files. The pose of a model, how the form is bent and the morphs are set can be saved as files and accessed through the library menu. Likewise, facial features can be save to keep the better facial expressions. Positions of the hands can be saved in hand files. Lighting and camera settings can be saved to resume a project with the same settings or keep a favorite set up. Hair files can also be saved, to maintain a certain hairdo.

     There are three classes of auxillary models. Clothing is an OBJ based files that uses the skeleton of the figure that it is surrounding, and it has morphs similar (but not exact) to the character for which it's designed. There are two classes of clothing files, conforming and non-conforming. A conforming file will accept the original model's morph settings so that it automatically adapts to the figure it is clothing. Non-conforming does not, and it much be adapted manually. Needless to say, conforming clothing is definitely more popular among the designers.
     Hair is a separate model with no skeleton, but it can contain morphs that allow it to be moved, lengthened, shortened, spread, swing during animations, etc. Hair will automatically conform to its proper place on the figure for which it was designed. It can also be used for figures for which it wasn't designed, though some adaptation and manual positioning must be done for proper results.
     Props are for the most part plain models imported from other modeling applications. The majority of them are static models, and most any 3D model can be converted to OBJ format and textured within Poser. Some props are special, and can contain morphs and conforming code. These allow for some special effects that are not possible with plain props, such as stretching other deformities. Props can be assigned parents, which is basically a means of assigning the same motions to the prop as is performed with the primary model. For example, a pen can be placed in a model's hand and parented to the hand. Thus, when the hand is moved, the pen moves with it, mimicking real life.

     Bckground images can be set in Poser to give the appearance of the model being in an environment. The rendering takes on the proportions of the background, so some pre-planning and editing in an image editor such as Photoshop is advisable. Identical lighting effects is probably the most overlooked aspect in creating backgrounds, and when they match up, the effect can be very realistic. There is some pixelation when the background is not rendered to its original size, so the image should be the same size as the rendering for best effects. The sister application Bryce is great for creating backgrounds.

     There are two types of files that can save the completed characters with all the clthes, modifications, etc. intact. The first is to create a character file, which can be saved to the library for future use. The other method is to save the scene file, complete with lighting, camera, background, other models, along with every other item and setting in the scene. The character file requires the original model, figure, and other items that were used to construct it. The scene file does not, as it contains all of the items used. Naturally, the scene files are much larger, often measuring 10M or more, while the character files usually measure about 2M.

     Poser models can be exported to other applications, such as Bryce, when both the model and environment must be moved in an animation. There are procedures for exporting the unusual textures, but they work well and can create some very nice effects. There are many applications where the export will take, Cinema 4D, LightWave, Maya, Electric Studio, Carrara, POV-Ray, Strata, and more.

     And Poser 4 is a dual platform application, available for both PC and Mac. With Poser Maconverter, it is very easy for a PC model to be imported to Mac. Going the other way is a bit harder, but possible by stripping the resource and changing the file to a text file. The preview files must be generated separately in the PC when going from Mac to PC, as in the Mac version, both the model and the preview are in the same file.

     All of the types of files listed above can be found on the internet, placed there free of charge by those who created them. There are also commercial models that can be purchased. The free models are there from a sense of giving back to the community that nutured the designers' interests ad capabilities in Poser. And Poser continues to grow steadily. The leading producer of commercial models, Zygote (the Poser division now renamed DAZ), created all the included models that come with the double CD for Poser 4. They have released a new set of models, Victoria and Michael, that have even greater control over the bends and morph, separating the head and body for higher resolution of the texture maps. The results are awesome, and with the versatility of the morphs of these two figures, virtually any human face and body can be mimicked. it just keeps getting better all the time. Consequently, while the items collected from the net can be used, they are quickly becoming obsolete as the new and better models replace them, and the community responds with more free support files for the new models.

     In essence, using Poser is a little like playing with dolls, but oh the differences at the adult level! It's certainly cheaper than a photographic model shoot, and it's getting much closer to being the same quality. For 3D lifeforms, it is becoming the obvious leader in the desktop market.






Software

     solidThinking 4.1 (Mac/PC) is the latest version of one of the hottest 3D modelers/rendering engines on the market today. Its nurbs manipulation tools allows for some of the very best organic modeling available on the desktop. It is capable of importing and/or exporting to DXF, Lightwave, 3DS, VRML, Illustrator and more, and its shader/texturing capabilities are simply superior. It is one of the most capable modelers available, making some serious waves in the lineup of the industry standard heavyweights. The renderings of which it's capable are absolutely eye-popping. For all serious 3D artists, this one needs to be considered as a mainstay production tool of the first order.



  

MAC CHAT DIRECTORY

INDEX