In computer image processing, understanding image types is the prerequisite for basic operations. This article, combined with Photoshop software operations, provides a detailed analysis of the definition, composition, operational logic, and application characteristics of raster image formats, helping beginners establish a comprehensive understanding of raster images.
1. Image Type Classification and Definition of Raster Images
Computer images are mainly divided into two categories:
- Raster Images: Also known as bitmap images, their core characteristic is being composed of countless "dots" (pixels) arranged in a matrix form, similar to creating patterns with mosaic tiles - each mosaic piece is a pixel, collectively forming a complete image.
- Vector Images: Unlike raster images, vector images are drawn based on mathematical paths (such as lines and shapes) and do not distort when enlarged (this article focuses on raster images, and vector images will not be discussed in detail).
In daily life, photos taken by digital cameras, documents scanned by scanners, and most images on web pages belong to raster images. For example, opening a typical raster image and operating in Photoshop allows for intuitive observation of its pixel composition.
2. Pixels: The Smallest Constituent Unit of Raster Images
2.1 Definition and Viewing Methods of Pixels
A pixel is the smallest indivisible unit of a raster image, like a single colored block in a mosaic collage. In Photoshop, you can view pixel information of an image through the following methods:
- After opening an image, click the menu [Image] → [Image Size]. In the pop-up dialog box, the "Pixel Dimensions" area will display the width (e.g., 400 pixels) and height (e.g., 225 pixels), which represent the number of pixels in the horizontal and vertical directions of the image.
- Viewing status bar information:
- In the "zoom percentage" area to the right of the status bar at the bottom of the image window, hold down the ALT key and click to display complete pixel information (e.g., "Width: 400 pixels Height: 225 pixels Channels: 3 (RGB color, 8bpc) Resolution: 72 pixels/inch").
- Version difference note: In Photoshop CS and earlier versions, the status bar can be enabled through the menu [Window] → [Status Bar]; Photoshop CS2 does not have this menu, so you need to directly view the default status bar.
2.2 Relationship Between Total Pixels and Image Fineness
- Total Pixel Calculation: Total image pixels = width pixels × height pixels. For example, 400 pixels (width) × 225 pixels (height) = 90,000 pixels, meaning the image consists of 90,000 pixels.
- Impact of Pixel Count: In most cases, the more pixels there are, the richer the details recorded in the image, and the finer the local areas. For example:
- An image with 90,000 pixels (400×225) will easily show "mosaic phenomena" (jagged edges) when enlarged;
- An image with 1.44 million pixels (1600×900) will have significantly finer local details under the same magnification ratio.
- Camera pixel specifications: The "13 million pixels" and "30 million pixels" of digital cameras essentially refer to the total pixel count of the images they capture.
3. Image Zoom Operations and Shortcuts in Photoshop
Image zooming is a frequently used operation in Photoshop. Mastering shortcuts can significantly improve efficiency. Specific operations are as follows:
3.1 Basic Zooming (with image center as origin)
- Zoom in on image: Press the shortcut key Ctrl + (hold down the Ctrl key and press the "+" key repeatedly to gradually zoom in);
- Zoom out on image: Press the shortcut key Ctrl - (hold down the Ctrl key and press the "-" key repeatedly to gradually zoom out);
- Zoom indicator: The image window title bar and status bar will display the current zoom percentage in real-time (e.g., 100%, 200%).
3.2定点 Zooming (with mouse click position as center)
*定点 Zoom in: First press the Space key, then press the Ctrl key (note: in Chinese Windows systems, "Ctrl + Space" defaults to input method switching, so it's recommended to press Space first, then Ctrl), then click on a certain area of the image with the mouse, and that area will become the zoom center; *定点 Zoom out: First press the Space key, then press the Alt key, click on a certain area of the image with the mouse, and that area will become the zoom center;
- Repeat operation: If the single zoom level is insufficient, you can repeat the above steps to continue adjusting.
3.3 Moving Method When Image Exceeds Window
When the image size exceeds the window size, horizontal/vertical scroll bars will appear. You can move the viewing area through the following methods (not moving the image itself):
- Drag the scroll bars on the right or bottom of the window;
- Hold down the Space key, the mouse will change to a "hand tool", hold down the mouse and drag within the image (you can release the space key during dragging).
4. Relationship Between Monitors and Raster Images
Monitors are essentially "raster display devices", and their display principles are directly related to the presentation of raster images.
4.1 Raster Characteristics of Monitors
- Common monitor types: Traditional CRT monitors (cathode ray tubes), LCD screens, and plasma screens all display images by illuminating pixels;
- Screen resolution settings: In Windows systems, screen resolution can be viewed/modified through [Control Panel] → [Display] → [Settings] (e.g., 1024×768 pixels), meaning the monitor can display 1024 pixels horizontally and 768 pixels vertically.
4.2 Relationship Between Image Display and Screen Resolution
Whether an image can be displayed completely on screen (at 100% original size) depends on the match between image pixels and screen resolution:
- Analogy example: A 6-inch photo cannot fit completely into a 5-inch frame. If the image's horizontal/vertical pixels exceed the monitor's corresponding resolution in that direction, the image will be truncated (requiring scrolling to view);
- Visual size changes: The same image (e.g., a 300×300 pixel square) will appear different in visual size under different resolutions:
- At screen resolution 800×600, 300 pixels occupy about 1/2 of the horizontal width;
- At resolution 1024×768, it occupies about 1/3 of the horizontal width;
- At resolution 1600×1200, it occupies about 1/5 of the horizontal width. Note: The actual number of image pixels has not changed. The visual size change is due to increased total screen pixels resulting in "reduced relative proportion", similar to "seeing a manhole cover from the 30th floor appears smaller than from the 5th floor" - the manhole cover's actual size remains unchanged.
4.3 Pixel Illumination Principle of CRT Monitors
CRT monitors excite pixels to emit light through "electron gun scanning". The specific process is as follows:
- There are 3 electron guns inside the monitor, corresponding to the three colors red (R), green (G), and blue (B);
- The electron guns emit electron beams that first strike the "origin point" (0 point) at the top-left corner of the screen, mixing RGB colors according to signal strength to complete the excitation of 1 pixel;
- Under the action of deflection coils, the electron beam moves right by 1 pixel and repeats the excitation until all pixels in 1 row are completed (called "line scanning");
- After line scanning ends, the electron beam moves down by 1 row and returns to the left to start the next line scan, continuing until all rows are completed (called "field scanning").
4.4 Screen Coordinate System Characteristics
Unlike the plane geometry coordinate system (origin at the bottom-left corner, Y-axis upward), the monitor screen coordinate system has its origin at the top-left corner, X-axis to the right, and Y-axis downward - this is determined by the electron gun's "left-to-right, top-to-bottom" scanning sequence, and is also the coordinate basis for Photoshop's processing of raster images.
4.5 Visual Persistence Effect
Screen pixels do not emit light simultaneously, but the human eye has the "visual persistence" characteristic (after an image disappears, vision persists for 0.1-0.4 seconds), thus allowing us to see complete, continuous images.
5. Storage and Web Display Characteristics of Raster Images
5.1 Storage Logic of Raster Images
When storing raster images in Photoshop, the software records the RGB color information of each pixel one by one according to the "screen scanning sequence" (starting from the top-left corner 0 point, X-axis to the right, Y-axis downward); when opening raster images, it extracts pixel information in the same order to restore and display on the screen.
5.2 Loading Issues of Raster Images on Web Pages
When browsing web pages, sometimes you see images "gradually displaying from top to bottom" - this is essentially slow network transmission speed causing pixel information reading delays. If loading time is too long, it easily degrades user experience, therefore:
- Raster images used for web pages need to minimize file size as much as possible (such as compressing pixel count and reducing resolution) to speed up transmission (specific optimization methods will be discussed in subsequent tutorials).
6. Photoshop Info Panel and Pixel Coordinates
Photoshop's "Info Panel" can display the pixel coordinates of the mouse in the image in real-time, helping with precise positioning:
- Open the "Info Panel": Menu [Window] → [Info];
- Coordinate viewing: The "X" and "Y" values in the panel represent the pixel position of the mouse hotspot in the image (e.g., X=130, Y=35, meaning the 130th pixel horizontally and 35th pixel vertically);
- Mouse hotspot definition: Refers to the point in the mouse cursor that serves for positioning (such as arrow cursor, with the hotspot at the arrow tip).
7. Raster Image Scaling Experiment and Distortion Causes
Through the "shrink then enlarge" experiment, we can intuitively understand the essence of raster image distortion. Specific steps are as follows:
7.1 Experimental Operation Steps
- Initial image: 400×225 pixels (90,000 total pixels), resolution 72 pixels/inch;
- Step 1: Shrink image
- Menu [Image] → [Image Size], change "Width" to 200 pixels;
- Due to the "Constrain Proportions" option being checked by default, height will automatically adjust to 113 pixels (not 225÷2=112.5, because pixels cannot be divided, integers are required);
- After shrinking: Image becomes 200×113 pixels, 22,600 total pixels (discarded 67,400 pixel information).
- Step 2: Enlarge image
- Open [Image Size] again, change "Width" back to 400 pixels;
- Height automatically calculates to 226 pixels (113×2), total pixels restored to 90,000 (400×226);
- Final effect: Image becomes blurry, details (such as left hand finger gaps) are lost.
7.2 Core Causes of Distortion
- Shrinking process: Photoshop will "equidistantly extract and discard pixels" (e.g., shrinking 10×6 pixels to 5×3 pixels will directly discard half the pixels), and discarded pixel information cannot be recovered;
- Enlarging process: To supplement pixel count (e.g., from 22,600 back to 90,000), Photoshop uses "interpolation algorithms" - essentially "guessing" the colors of lost pixels:
- Example: Expanding 2×2 pixels (A, B, C, D) to 3×3 pixels requires adding 5 pixels (1, 2, 3, 4, 5). The software takes the average color of adjacent pixels as the new pixel color (e.g., the average of A and B is pixel 1, the average of A and C is pixel 2, and so on);
Note: The above is a simplified analogy for understanding. Actual interpolation algorithms (such as "bicubic") are far more complex than this, but their core is "estimation" rather than restoring original pixels.
- Example: Expanding 2×2 pixels (A, B, C, D) to 3×3 pixels requires adding 5 pixels (1, 2, 3, 4, 5). The software takes the average color of adjacent pixels as the new pixel color (e.g., the average of A and B is pixel 1, the average of A and C is pixel 2, and so on);
- Detail loss example: In the original image, "left hand finger gaps" are dark pixels. After shrinking, dark pixels are discarded, leaving only light pixels; when enlarging, the interpolation algorithm can only calculate based on light pixels and cannot restore the dark finger gaps, resulting in a blurry image.
7.3 Key Concept Clarification: "Enlargement ≠ Restoration"
"Shrink then enlarge" in the experiment is not "restoration" for the following reasons:
- Definition of restoration: "Restoration" in Photoshop means "undoing the previous operation" (such as menu [Edit] → [Undo"]), which does not modify the image itself;
- Essence of enlargement: It is a modification operation of "adding estimated pixels". Even if the total pixel count is restored, the original details lost cannot be retrieved;
- Size deviation: Due to indivisible pixels (e.g., 225÷2=112.5≈113), the height becomes 226 pixels after enlargement, differing from the initial 225 pixels, meaning the image size has changed.