VMware ESXi and vSphere Cluster Management
Images: Formats, Resolution, Color, and Web Use
Learn digital image fundamentals, including raster and vector graphics, pixels, resolution, color, formats, compression, accessibility, copyright, and web optimization.
A digital image is visual information stored as digital data in a computer-readable format. Images can represent photographs, illustrations, icons, diagrams, logos, interface graphics, and other visual content used in documents, presentations, applications, and web pages.
Raster and Vector Images
A raster image is built from a fixed rectangular grid of pixels. A pixel is the smallest addressable picture element in a raster image or display. Digital photographs are usually raster images because they contain many small color variations.
A vector image is represented by mathematical paths, curves, lines, and shapes. Because the image is described mathematically, it can usually be enlarged without becoming pixelated. Logos, icons, diagrams, and simple illustrations are often good candidates for vector artwork.
- Raster: best for photographs and detailed pixel-based artwork; quality depends on available pixels.
- Vector: best for scalable logos, symbols, diagrams, and illustrations; requires suitable vector source artwork.
Pixels and Image Dimensions
Pixel dimensions describe an image's width and height in pixels. An image described as 1920 by 1080 has 1920 pixels across and 1080 pixels down, for a total of 2,073,600 pixels.
More pixels can provide more detail and allow a larger display or print size, but pixel count alone does not guarantee quality. Focus, lighting, camera quality, editing, and compression also affect the result.
An image's aspect ratio is the proportional relationship between its width and height. A 1920 by 1080 image has a 16:9 aspect ratio. To preserve that shape, a 1600 by 900 image can be resized to 800 by 450. Changing it to 800 by 800 changes the proportions and makes the image look stretched or squashed.
Resolution and Print Size
Resolution can refer to image detail or to the density used when outputting an image. Pixel dimensions and print resolution are related but are not the same thing.
- PPI means pixels per inch. It is commonly used for image density and the relationship between pixels and physical display or print size.
- DPI means dots per inch. It is commonly used in printing to describe the density of printed dots or ink output.
Print width can be estimated with this formula:
print width in inches = image width in pixels / PPI
For example, a 3000-pixel-wide image prints at approximately 10 inches wide at 300 PPI:
3000 / 300 = 10 inches
At 150 PPI, the same pixels cover approximately 20 inches:
3000 / 150 = 20 inches
Changing a resolution metadata value does not create missing detail. If an image has too few pixels, assigning it a higher PPI value only changes the expected physical size; it does not add useful information.
Color Models, Channels, and Color Depth
RGB is a screen-oriented color model based on red, green, and blue light. Different intensities of these three channels combine to produce colors on displays.
CMYK is a print-oriented model based on cyan, magenta, yellow, and black inks. A color that appears bright on an RGB screen may not be reproducible with CMYK inks, so screen and print previews can differ.
A channel stores one component of image information, such as red, green, blue, or transparency. Color depth describes how much data is used to represent each pixel or channel. More bits allow more possible tones and colors. For example, 8 bits per RGB channel can represent 256 levels per channel and roughly 16.7 million RGB combinations.
An alpha channel stores transparency information. Fully opaque pixels, partially transparent pixels, and fully transparent pixels can coexist in an image when the format and export settings support alpha data.
A color profile is metadata that helps software interpret colors consistently. Different screens, browsers, applications, printers, and profiles can display or reproduce the same file differently. For important work, use a consistent color-managed workflow and check a print proof when possible.
Common Image File Formats
| Format | Raster or vector | Lossy or lossless | Transparency support | Animation support | Best uses | Limitations |
|---|---|---|---|---|---|---|
| JPEG | Raster | Usually lossy | No standard alpha transparency | No | Photographs and full-color images | Repeated saving or aggressive compression can create artifacts; unsuitable for sharp transparency |
| PNG | Raster | Lossless | Yes | Not generally used for animation | Logos, screenshots, diagrams, and images needing clean edges or transparency | Often larger than JPEG for photographs |
| GIF | Raster | Lossless compression with a limited color palette | Limited transparency | Yes, simple frame animation | Simple animated graphics and very limited-color artwork | Limited colors and inefficient for photographs |
| SVG | Vector | Usually described by editable vector data | Yes | Can support animation through suitable techniques | Scalable logos, icons, diagrams, and interface graphics | Not a direct replacement for detailed photographs; external content must be handled safely |
| WebP | Raster | Lossy or lossless | Yes | Yes | Web photographs, graphics, and transparent images | Check the requirements of target software and workflows |
| AVIF | Raster | Lossy or lossless | Yes | Can support animation | Efficient web delivery where browser and tool support are suitable | Encoding and editing support may vary; test compatibility |
Lossy compression discards some data to reduce file size. It can be effective for photographs, but excessive compression produces blockiness, ringing, smeared detail, and other compression artifacts. Lossless compression reduces file size without discarding image data, which is useful when exact pixels must be preserved.
Compression, File Size, and Optimization
Image files can be large because they contain many pixels, multiple color channels, transparency data, metadata, animation frames, or high-quality source information. Large files take longer to upload, download, store, and display.
Resizing changes the number of pixels. Compression changes how the file data is encoded and may reduce quality. These are separate operations. A large image can be compressed and remain large in dimensions; a small image can be resized without necessarily being strongly compressed.
- Crop away unwanted composition before exporting.
- Resize near the largest dimensions actually required by the output.
- Choose a suitable format for the content.
- Compare quality and file size at several compression settings.
- Remove unnecessary metadata when appropriate, while retaining licensing and production records elsewhere.
- Use responsive image resources so devices do not download unnecessarily large files.
Resizing, Scaling, Cropping, and Editing
Resizing changes an image's pixel dimensions. Scaling for display changes how large it appears in a layout without necessarily changing the source file. Cropping removes outer portions of an image to change its composition or dimensions.
When a raster image is enlarged, the software must calculate new pixels. This process is called resampling or interpolation. Resampling cannot recover detail that was never present, so enlarging a small image can cause blur, jagged edges, or pixelation. Use a higher-resolution source, display the image smaller, or use vector artwork when appropriate.
For safer editing, retain the original source file, work on a copy, use editable layers or adjustment controls when available, and export a separate delivery file. This is a basic non-destructive editing practice: it preserves the ability to revise the work without repeatedly damaging the original.
Using Images on the Web
HTML includes an image with the img element. The src attribute identifies the resource, and alt provides a textual alternative.
<img src="images/mountain-trail.webp" alt="Hikers walking along a mountain trail at sunrise" width="1200" height="800">
Explicit width and height values describe the image's intrinsic proportions and allow the browser to reserve space before the file loads. This helps reduce layout movement. CSS can make the image fit its container without distortion:
img {
max-width: 100%;
height: auto;
}
Use a correct relative or absolute path, consistent file naming, and exact capitalization. A path that works on one case-insensitive computer may fail on a case-sensitive server. After deployment, check the image request in browser developer tools and confirm that the URL returns the intended file rather than a missing-file error.
Responsive Images
A responsive image provides an appropriate resource for the user's device and layout. The srcset attribute lists candidate files and their widths. The sizes attribute tells the browser how wide the image is expected to appear at different viewport sizes.
<img src="images/river-1200.webp"
srcset="images/river-640.webp 640w, images/river-1200.webp 1200w, images/river-2000.webp 2000w"
sizes="(max-width: 700px) 100vw, 700px"
alt="River flowing through a wooded valley"
width="1200"
height="800">
loading="lazy" can defer below-the-fold images until they are near the viewing area:
<img src="images/gallery-item.webp" alt="Ceramic bowl with blue glaze" width="900" height="600" loading="lazy">
Lazy loading is useful for noncritical content lower on a page. Do not use it indiscriminately for an important image that appears immediately when the page opens.
Accessibility and Meaningful Alternatives
Alt text is a textual alternative that conveys an image's purpose to people who cannot see it, including some screen-reader users. Write it for the surrounding context rather than describing every visible detail.
- A search button shown as a magnifying-glass icon can use
alt="Search". - A content photograph can identify the relevant subject and action, such as
alt="Hikers walking along a mountain trail at sunrise". - A decorative divider that adds no information should use an empty value:
alt="".
<img src="images/divider.svg" alt="" width="800" height="24">
Images containing essential text, data, or instructions require equivalent accessible content in HTML text, a nearby description, a data table, or another usable alternative. Do not rely on an image alone for information that users must read or follow.
Copyright, Licensing, and Attribution
Online availability does not automatically grant permission to copy or reuse an image. Before using an image, identify its creator and license or obtain permission.
- Public-domain material: generally has no active copyright restrictions, although other rights or source rules may still apply.
- Creative Commons material: follows the conditions of its specific license. Some licenses require attribution, prohibit commercial use, prohibit modifications, or require sharing adaptations under similar terms.
- Stock images: are used under the purchased or granted license, which may limit audience, duration, distribution, or modification.
- Permission-based use: requires keeping evidence of the permission and following its conditions.
Retain the source, creator, license, attribution wording, download date, permission records, and any modifications. Provide attribution whenever the license or permission requires it.
Evaluating Image Quality
Common quality problems include blur from focus or motion, pixelation from insufficient dimensions, digital noise, banding in smooth gradients, poor contrast, unwanted color casts, and compression artifacts.
Quality requirements depend on context. A small thumbnail, a full-screen presentation image, a printed poster, and a logo all need different dimensions and characteristics. Inspect the image at its intended output size, not only while zoomed in. A file that looks imperfect at extreme magnification may be entirely suitable at its actual display size, while a small image may fail when enlarged.
| Observed issue | Likely cause | How to verify | Recommended fix |
|---|---|---|---|
| Stretched or squashed appearance | Displayed width and height do not preserve the aspect ratio | Compare source and displayed ratios | Set one dimension and keep the other automatic, or calculate proportional dimensions |
| Blurry after enlargement | Small raster image enlarged beyond its available detail | Compare displayed size with pixel dimensions | Use a higher-resolution source, reduce display size, or use suitable vector artwork |
| Slow page loading | Files or dimensions are much larger than required | Inspect file sizes and network requests | Crop, resize, compress, select an efficient format, and lazy-load noncritical images |
| Transparent background becomes solid | Format or export settings discarded alpha data | Open the file over a contrasting background | Export as PNG, WebP, AVIF, or SVG with transparency enabled |
| Print colors differ from screen | RGB and CMYK have different color capabilities or profiles are inconsistent | Compare a profile-aware preview with a test print | Use the printer's color workflow and request a proof for important work |
| Image does not appear on a web page | Incorrect path, capitalization, deployment location, or URL | Inspect the image request in developer tools | Verify the exact deployed path, filename, and server response |
| Screen reader receives poor information | Missing, repetitive, or purpose-free alt text | Review the page with a screen reader or accessibility checker | Write concise contextual alt text, provide equivalent content, or use empty alt for decoration |
Image Preparation Checklist by Use Case
| Use case | Suggested format | Dimension considerations | Compression priority | Accessibility requirement |
|---|---|---|---|---|
| Photograph on a web page | JPEG, WebP, or AVIF | Prepare near the largest intended display width and offer responsive sizes | High; balance download size with visible detail | Describe the photograph's purpose and relevant subject |
| Transparent logo | SVG for vector artwork; PNG, WebP, or AVIF for pixel artwork | Preserve proportions; vector artwork can scale cleanly | Reduce unnecessary raster dimensions and metadata | Use the brand or action meaning, not merely “logo” when context needs more |
| Diagram or screenshot | PNG, SVG, WebP, or AVIF as appropriate | Ensure text remains readable at intended size | Favor clarity over extreme compression | Repeat essential text, data, or instructions in accessible content |
| Simple animation | GIF, animated WebP, or animated AVIF when supported | Keep frame dimensions and frame count appropriate | Important because animation can become large quickly | Provide an equivalent description and avoid conveying essential information only through motion |
| Print document | Format supported by the production workflow, often TIFF, PNG, JPEG, or PDF-contained artwork | Calculate physical size from pixels and target PPI | Preserve enough detail for output; avoid damaging repeated exports | Ensure document text and data have accessible equivalents where required |
Practical Workflow
- Identify the image's purpose: photograph, logo, diagram, decoration, or interface control.
- Choose raster or vector artwork based on whether fixed pixels or scalable shapes are appropriate.
- Determine the required pixel dimensions or physical print size.
- Preserve the aspect ratio unless intentional distortion is part of the design.
- Crop and edit from an original source, preferably non-destructively.
- Choose RGB for screen delivery or follow the printer's CMYK and profile requirements for print.
- Export in a suitable format and compare quality at the intended output size.
- Add meaningful alt text or an empty alt attribute when the image is decorative.
- For web pages, provide intrinsic dimensions, responsive candidates where useful, and lazy loading for appropriate noncritical images.
- Verify paths, deployed URLs, licenses, attribution, and final performance.
For additional practice, continue with image fundamentals and web image use.