Sie sind auf Seite 1von 7

Image File Basics

By Connor Gresko

Computer Graphics Hardware Pipeline (For Image Files): VRAM


Image File is Loaded from Disk, prompted from the program into RAM. Image File Data is Parsed from the original File, by the program into RAM. The original file is no longer needed. Image file data is then sent to the Graphics Cards RAM, so that it can quickly draw the image to the screen. (AKA, VRAM). Program Prompts the graphics card to display the image on the output device (VIA, Monitor.
GPU

Monitor

CPU

X X
RAM

DISK

TIP: The Disk would be your Hard Drive. The CPU is the brain of the computer that Operates your program. Your GPU that Nvidia or GEForce you Begged your parents for Christmas.

Image Files
Ones were familiar with: .Png very common. .Bmp not so common, but generally used for MS Paint. .JPEG A Lossy, compressed image file, used on the internet for faster loading Other File Types: .Targa used a lot in Video Games. .ico Used for icons for Applications.

Data in a file
All images contain color data for each and every pixel in an image. Formats of color data varies between file formats, depending on compression, and architecture of files (E.G. .PSD), however, the most common data format is the classic RGB, or RGBA. Most often is 24 or 32 bits each pixel. TIP: 32 Bits = 1 Byte 32 BITS Red 1024 Bytes = 1 Kilobyte Green 1024 Kilobytes = 1 Megabyte Blue BYTE BYTE BYTE BYTE Alpha for transparency. Think windows. Average file size is a few Kilobytes to a few MegaBytes, depending on file size. E.G. 1024 X 1024 X 32 BITS = 33554432 BITS, or Approximately, 4 MegaBytes.

How Colors In Image Files Mix.


Color data for each RGBA Component, is within range from 0.0, to 1.0. E.G. Yellow would be a combination of Red and Green, with values higher that 0.0, but with no Blue value: Red: 1.0, Green: 1.0, Blue: 0.0 = Yellow.
Alpha is also within the range of 0.0 to 1.0, and affects transparency. E.G. 1.0 = Completely opaque, and 0.0 means completely transparent.

Librarys and APIs for managing graphics


Just like #include <iostream> is used for drawing text in cmd.exe, these libraries and APIs are used for drawing computer graphics. Windows GDI Used for all windows apps and programs. Not very powerful. Very commonly used for 2D applications in Windows Forms. DirectX Windows specific graphics API, used for Windows Products only (E.G. XBOX 1 and Windows 7, 8.)

OpenGL Multiplatform Most Generic, widely used in most 3D Applications.


Coco Used for the Macintosh. Most Iphone apps use this. Also supports OpenGL. SDL A Wrapper around OpenGL, and DirectX. Very commonly used for indie Games. And Many More!

Any Questions?

Cookies, maybe? :3

Das könnte Ihnen auch gefallen