ArticleslgStudy

computer science

IMG (file format)

IMG (file format) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand IMG (file format) rather than just read about it. In short: An IMG file, a.k.a. raw disk image, contains a complete and uncompressed disk image of a storage device's data content. The image includes the value of each memory location of the storage device, ordered sequentially such that the data can be written to a similar device to completely overwrite its content.

Key takeaways

  • IMG (file format) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect IMG (file format) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of IMG (file format) from memory before moving on to harder problems.

Reference excerpt

An IMG file, a.k.a. raw disk image, contains a complete and uncompressed disk image of a storage device's data content. The image includes the value of each memory location of the storage device, ordered sequentially such that the data can be written to a similar device to completely overwrite its content. The layout of data in a raw image depends on the file system of the target storage device (for example FAT). For example, an optical disc (i.e. CD or DVD) raw image contains the tracks of audio or video. In the case of a CD-ROM or DVD, an image usually includes not only the data of each sector, but the control headers and error correction fields for each sector as well. Since raw image files hold no additional data ("metadata") beyond the storage content, determining the structure of an existing image can be difficult. Either a user remembers what a file contains via their memory or records metadata in the file name or via some other mechanism. In some cases, a tool can detect aspects of an image file's content. For example, a typical floppy disk raw image begins with a FAT boot sector, which can be used to identify the file system. A raw optical disc image is usually accompanied by a separate file which describes the layout of the image data, including information such as track limits which are not in the raw image.

Filename extension Raw disk image files sometimes have the filename extension .img, but the extension is used for other file formats and often other extensions are used for a raw disk image file. The .img file extension was originally used for floppy disk raw disk images only. A similar file extension, .ima, is also used to refer to floppy disk image files by some programs. A variant of raw image, called IMZ, consists of a zipped version of a raw floppy disk image (containing one entry with filename extension .IMA). These files use the .imz file extension, and are commonly found in compressed images of floppy disks created by WinImage. QEMU uses the .img file extension for a raw image of a hard disk drive and calls the format "raw". CloneCD stores optical disc images in .img files and generates additional CloneCD Control Files (with .ccd extension) for each image to hold the necessary metadata. The CUE/BIN format stores disc images in .bin files, which are functionally equivalent to .img image files, and uses .cue files as descriptor files. The extension .img is also used for (unrelated) planar graphics files, originating with Digital Research's GEM. It was commonly used on the Atari ST line of home computers, but also with some GEM-based PC software such as Corel Ventura or Timeworks Publisher. An Apple Disk Image file name may include the .img extension. Garmin .img is a hard-disk image file format which contains a header and many subfiles and used to store the maps for its GPS units.

Size For devices with sectors, the size of a raw disk image is a multiple of the sector size. For floppy disks and hard drives, this size is typically 512 bytes (but other sizes such as 128 and 1024 exist). More precisely, the file size of a raw disk image of a magnetic disk corresponds to:

Cylinders × Heads × (Sectors per track) × (Sector size) E.g. for 80 cylinders (tracks) and 2 heads (sides) with 18 sectors per track:

80 × 2 × 18 × 512 = 1,474,560 bytes or 1440 KB For an optical disc such as a CD or DVD, the raw sector size is usually 2,352, making the size of a raw disc image a multiple of this value.

Comparison to ISO images ISO images are another type of optical disc image files, which commonly use the .iso file extension, but sometimes use the .img file extension as well. They are similar to the raw optical disc images, but contain only one track with computer data obtained from an optical disc. They cannot contain multiple tracks, nor audio or video tracks. They also do not contain the control headers and error correction fields of CD-ROM or DVD sectors that raw disc images usually store. Their internal format follows the structure of an optical disc file system, commonly ISO 9660 (for CDs) or UDF (for DVDs). The CUE/BIN and CCD/IMG formats, which usually contain raw disc images, can also store ISO images instead.

Tools The raw image file format is used by several tools:

RaWrite and WinImage use the raw image format to read and write floppy disk images ImDisk and Virtual Floppy Drive can mount a raw image of a floppy disk to emulate a floppy drive under Microsoft Windows Nero Burning ROM supports reading raw image files for creating bootable CDs mtools allows manipulation of MS-DOS floppy disk images in Unix systems Programs such as dsktrans from the LibDsk suite of command-line tools (available for Linux, MS-DOS, and Microsoft Windows) will convert between different raw disk image formats dd can read and write raw image files QEMU uses raw image files as its default format for hard disk drive images IrfanView with the plugin "FORMATS" (formats.dll) supports viewing GEM-IMG vector graphics Garmin MapSource or GPSMapEdit can be used to read Garmin hard-disk image .img format

References

Worked examples

Example 1 — a first encounter with IMG (file format)

Start with the simplest possible case. Write down what IMG (file format) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to IMG (file format) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about IMG (file format) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of IMG (file format)

In research
IMG (file format) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses IMG (file format) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
IMG (file format) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Archive formats, Computer file formats, so understanding it makes those chapters shorter.
In everyday life
Look for IMG (file format) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “IMG (file format)” →

How to study IMG (file format) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what IMG (file format) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain IMG (file format) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is IMG (file format) in simple terms?

An IMG file, a.k.a. raw disk image, contains a complete and uncompressed disk image of a storage device's data content. The image includes the value of each memory location of the storage device, ordered sequentially such that the data can be written to a similar device to completely overwrite its…

Why does IMG (file format) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study IMG (file format)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on IMG (file format).

Tags

  • Archive formats
  • Computer file formats

Keep exploring