Image Viewer

A powerful multi-media image viewing
Application for C64 OS





Image Viewer Application triptych.




Introducing Image Viewer

Image Viewer Icon.

Image Viewer is an Application for C64 OS that is used to view graphic images in a myriad of different source formats, by means of dynamically loaded image datatype loaders. Image Viewer is capable of much more than just displaying static graphic images, it is an interactive multi-media viewer.

It is capable of displaying still images in all native video modes: hi-res bitmap, multi-color bitmap, as well as hi-res character mode, multi-color character mode and extended background character mode. Character modes can use either of the character sets built into ROM for default PETSCII graphics, or can provide their own custom character set, ideal for many in-game screenshots that use a character mode with a custom tileset.

In addition to still images, Image Viewer supports multi-frame images if a Commodore 1750 (or compatible) REU is available. Multi-frame images can be used to support more complex interactions, such as panoramas (images wider than the screen), look-around scenes in two dimensions (images both wider and taller than the screen), 3D objects that can be rotated in two dimensions, and animations up to 255 frames. The multi-frame images can have frame formats in any of the supported video modes.

Image Viewer is an extensible multi-media display and playback Application for C64 OS. Greg Nacu — 2024 — C64OS.com


An OS needs Apps, but Apps need an OS.

Made For C64 OS badge.

For an operating system to be useful, it needs Applications. At the same time, Applications written for C64 OS take advantage of the frameworks provided by the OS to minimize the amount of work that has to go into the App itself.

A great App fits into the system; it looks and behaves like a native citizen of the environment, but also provides some new ability that isn't available in other environments on the platform. Image Viewer is among of the first Applications to fulfill the promise of C64 OS.

Image Viewer takes advantage of the mouse and menus input system provided by the OS. It makes use of the amazing split screen and full screen graphics modes that are built into C64 OS at a low-level with the assistance of the gfx library. Files can be opened from File Manager by assigning Image Viewer as the default opener for the file's datatype.

Files can be opened from within Image Viewer by using the C64 OS Open Utility, which gives access to the complete file system, all partitions and subdirectories, of all the devices supported by the OS. Which means automatic support for CMD HD, RAMLink, IDE64 and SD2IEC, as well as the classics, like 1541, 1571 and 1581, or even VICE FS if you're running in the VICE emulator. All of this comes to Image Viewer essentially for free, so it can focus on what's unique to it.

Image Viewer - Split Screen - NX01 Enterprise.
The Enterprise, NX-01, Multi-Color, in Split Screen.

How to use Image Viewer

Launching Image Viewer

There is more than one way to launch the Image Viewer Application. You can create an alias on one or more of the App Launcher desktops; this allows you to quickly jump into Image Viewer or jump between Image Viewer and other Applications configured on the same desktop.

Alternatively, you can use File Manager to navigate to the Applications directory, choose Applications from the Go menu, or press F4. Double-click the Application bundle to launch Image Viewer.

If Image Viewer is not currently open, you see the standard Application launch screen pictured below. If Image Viewer is already open in a Fast App Switching bank, you do not see the launch screen but jump directly into the App just as it was when it was frozen to the REU. (See: the Online C64 OS User's Guide → Chapter 4. User Interface → viii. Fast App Switching.)

Image Viewer Application launch screen.
Image Viewer Application launch screen.

When Image Viewer first opens, its main user interface is displayed, but no file has been loaded in and nothing is currently available to view. While no image file is loaded in, split screen and full screen graphics modes are not available.

Two label boxes are displayed on the main screen, Info and Metadata. Info has fixed, non-editable fields for the image file format, the video mode, the image's pixel dimensions and the image's data size. These values are supplied by the datatype loader used to load an image file.

The Metadata label box is for presenting additional information that may or may not be available, depending on the file format of the open image. Artist is the name of who created the image, source is where it was downloaded or captured from, copyright year is the date or year that the image was created, and title is for an image's title, which is sometimes longer than what is capable of being stored in a 16-character filename. Rating allows an image file to be assigned a rating.

Image Viewer Application main user interface, no image loaded.
Main user interface, with no image loaded.

Although the metadata fields are editable, it only makes sense to modify these fields if the image will subsequently be saved to a file format that supports the retention of this information. An example would be, opening a file in, say, Art Studio format, adding metadata and then saving the file as a Commodore Grafix (CGFX) file. Saving the metadata (including the rating) is not yet available, but is scheduled for future development.


How to view an image

Once Image Viewer is open, there are several ways to open an image file.

From the File menu, choose Open Image. Or, press COMMODORE+O to trigger this menu option with the keyboard. This opens the C64 OS Open Utility, which is a standard file picker.

File Picker - Open Utility.
File Picker - Open Utility

Choose the device from the list of available devices in the top left of the Open Utility. This takes the main directory listing to the root of that device. If the device has partitions, you can double-click one of its partitions to navigate into it. You can navigate into sub-directories by double-clicking on them. The path to the current directory is shown in the path bar above the list of files. To navigate up to any parent directory, click on either the two dots (../) that represent that directory, or the first two slashes (//) to go to the root directory of the current partition.

You can also navigate the file system within a partition using the keyboard. Press COMMODORE+P to navigate to the parent directory. Press COMMODORE+R to navigate to the root directory of the current partition. Press the CURSOR-UP and CURSOR-DOWN keys to move the selection. Press COMMODORE+O while a sub-directory is selected to navigate into that sub-directory. To change devices, or to change partitions on the current device, it is necessary to use the mouse to click on the device in the devices list. Press RETURN and COMMODORE+O while a file is selected to choose that file to be opened by Image Viewer, or double-click a file, or click the Open button at the bottom right.

Only a file with a valid filename extension1 can be opened. If a file is selected with no extension, the Open button is disabled, and the other methods of opening that file are disabled as well. This is because Image Viewer uses the filename extension to determine the datatype, and pick an appropriate datatype loader. More about datatype loaders and image file formats below.

Recents and Favorites

Below the list of devices is the list of recently accessed files and favorite places. Click the Recents section header to toggle to favorites, and click the Favorites section header to toggle back to Recents. Favorites are global to the entire operating system and are configured in File Manager. Click on a favorite place to jump directly to that device, partition and directory path.

Recents are Application-specific. This means that files recently accessed in other Applications do not appear here in Image Viewer. The files listed here are the files most recently opened or saved using the Open or Save Utility from within Image Viewer. Click on a recent file to select that file at the device, partition and directory path where it is found.

Showing the image

Once an image file is selected to be opened, Image Viewer uses the file's extension to look for a datatype loader appropriate for the image's file and data format. If a matching datatype loader cannot be found then the file field, and the info and metadata fields are left blank. Otherwise, the datatype loader is loaded in, which then loads and unpacks the image data.

The file field holds the name of the currently open image file, and the Info fields are populated with information about the open image. The metadata fields will only be populated if that information is available for the datatype loader to extract from the file.

Drag the status bar up from the bottom of the screen to split the screen. In split screen mode you see the main user interface above the split and the graphic image on the screen below the split. You can move the split to see more of one and less of the other. Double-click in the center of the graphics area (below the split) to enter full screen graphics mode. In this mode, the graphic image fills the screen and the main user interface can be accessed with the mouse. Keyboard shortcuts on menu items can still be activated. If the action taken requires the main user interface to be displayed again, the full screen graphics mode or the split screen mode are exited automatically.

To leave full screen graphics mode, double-click again anywhere in the center of the graphics area, or single click anywhere while the mouse pointer is at the top of the screen inside the area where the menu bar is usually shown.

An example image open in split screen. An example image open in split screen.
Example images open in split screen

You can also use the View menu to choose full screen or split screen graphics mode. These menu options also have keyboard commands. Press COMMODORE+D to toggle the split screen mode open or closed. Press COMMODORE+F to toggle full screen graphics mode on or off. You may also use the operating system's global keyboard command COMMODORE+← to toggle full screen graphics mode on or off.


Interactive Images

In addition to static images, Image Viewer can also display and interact with a variety of different matrix or multi-frame images. The 3D Koala image file format (.3dk) supports a fixed number frames arranged in a matrix of rows and columns.

While in full screen graphics mode, if the image has more than one row or column, the standard mouse pointer is changed to either a double-headed arrow, vertical or horizontal, or a four-headed arrow, to indicate the directions that the image can be dragged. Click and hold anywhere in the graphics area and move the mouse to rotate the image.

The following video preview shows how this format allows for images to hold 3D models which can be rotated continuously in 360 degrees left and right, or top to bottom through several degrees so you can either look down on the object from above, or look up on the object from below.

3D model of a Teapot in Commodore Grafix format.
Watch the video preview.

Full screen vs. split screen

Image interactions only operate in full screen graphics mode. While in split screen mode only the current frame is displayed.

The Commdore Grafix format (.cgfx or .cgx) offers a greater number of options for interactive images. Panorama images offer a number of frames in a single row that can be panned through left and right. The number of frames, and the number of matrix rows and columns, and the direction (vertically or horizontally) through which an image can be continously rotated are all customizable properties of the image.

This format and its options allow for panoramas to be extended into full look-around scenes. In a look-around scene, your perspect is standing in the middle looking out at the scene. You have the ability to look up to the sky or ceiling, or look down to the floor or ground, and can look left or right, or even all the way in a circle to see the scene in 360 degrees that wraps around you.

Example frames from a panorama image with 6 columns.
Example frames from a panorama image with 6 columns

Example of some frames from a 3D Koala.
Example of some frames from a 3D Koala. The full matrix is 8 columns by 5 rows.

Animations

The Commodore Grafix format also supports short animations, and Image Viewer has support for playing them back. An animation may have up to 255 frames, with a customizable framerate to a maximum of 10 frames per second. This is the standard framerate used by most animated GIFs.

When an animation is loaded in, there are several options available from the Animation menu. Choose Play or press COMMODORE+P to start playing the animation. Full screen graphics mode is entered automatically to begin playback. While in full screen graphics mode, press the SPACE key to play, pause or resume the playback.

Some animations naturally play to their final frame and then stop. Other animations are designed to repeat so that they playback continuously. Each image file may specify an unlimited or a limited number of repetitions. There are two repetition modes: Loop and Bounce. Each image file specifies its default mode, but this can be changed for fun and entertainment using the Loop and Bounce options from the Animation menu.

Animation sequence of Enterprise going to warp in Commodore Grafix format.
Watch the video preview.

When an animation loops, it plays from the first frame to the last and then repeats from the first frame again. When an animation bounces, it plays through from the first to the last frame, but then changes direction and plays from the last frame back to the first. Bounce comes from an animation of bouncing ball. Because the downward fall of a bouncing ball repeats the same frames in reverse, the complete animation sequence can be captured in only half the frames.

Additionally, while paused, an animation functions like a long panorama, allowing you drag left or right with the mouse to scrub through the frames. This is particularly interesting with animations that naturally loop. In the example below, the animation loops continuously because the Earth itself rotates continously. However, pausing the animation allows you to use your mouse to freely rotate the Earth, in either direction, and continuously in 360 degrees.

Thus, some animations can also double as a kind of interactive model.

Interactive spinning Earth animation in Commodore Grafix format.
Watch the video preview.

File operations

While looking at an image file, you may feel that the name is not appropriate to the file's graphic content. The file can be renamed or copied to a new name from within Image Viewer, by means of the File Info Utility.

Choose File Info from the File menu, or press COMMODORE+I, to open the File Info Utility. Change the filename in the Utility's Name field and click the Rename button. The file is renamed on disk, and Image Viewer is updated in the background to reflect the new name. Alternatively, enter a new filename and click the Copy button to create a copy of the current image file with the new name. You may also use the the Lock checkbox to lock this image file to prevent it from being accidentally scratched.

File Info to edit the current image file's name.
File Info to edit the current image file's name

Quick open

Image Viewer's main interface begins with a File field. When an image file is open, the filename is displayed in this field. This is not just a label, but an editable text field. If you know the name of a different image file stored in the same place as the current image file, simply type the name of the new image file and press RETURN.

The new image file is loaded in place of the current image file. This is exactly the same as opening a new image file, if the new file's datatype is different, a new datatype loader will be searched for and used to load the new file's data.

Using the quick open feature is much faster that opening the full Open Utility, which must load in its own user interface, plus libraries, and plus the directory of files. However, quick open can only be used to change the filename, not the directory, partition or device where the file is found.

Change the filename in the File field to quickly open a new file.
Change the filename in the File field to quickly open a new file

Open a file from File Manager

In addition to using the Open Image option from the File menu, image files can be opened in Image Viewer directly from File Manager.

Image Viewer is assigned as the default opener Application for all of the file extensions for which there is a datatype loader. Therefore, simply double-clicking on an image file in File Manager, or selecting the file and choosing Open from the File menu, launches Image Viewer and loads that image file.

If for some reason an image file is opening by default in a different Application, hold the CONTROL key down immediately after choosing to open a file. This will reveal the Opener Utility's panel. On this panel, you can choose Image Viewer from the list of Applications and click the Assign button to assign Image Viewer again to this file type, or just click the Open button to open the file in Image Viewer this one time without changing the default assignment.

Advanced options with Fast App Switching

If you have an REU and have configured C64 OS for Fast App Switching, using File Manager is the fastest way to open new files in Image Viewer. When you choose Go Home from the File menu, you are switched to File Manager instantly. When you choose to open an image file, you are switched back to Image Viewer instantly.

There is some load time associated with opening the Opener Utility (which usually takes place behind the scenes) and it loads in the list of available Applications and Utilties. Hold the CONTROL key while Opener is opening to force it to show its user interface panel. When you click its Open button, you are switched to Image Viewer instantly. But when you Go Home again, and switch back to File Manager, the Opener Utility is still open on the screen. Select a new file and click the Opener's Open button. This eliminates the time needed to load the Opener, and greatly accelerates the rate at which you can navigate between different image files, even when they are stored in different places.

(See: the Online C64 OS User's Guide → Chapter 4. User Interface → viii. Fast App Switching.)

Double-click an image file in File Manager to open in Image Viewer.
Double-click an image file in File Manager to open in Image Viewer

Save a custom boot screen

When C64 OS boots, it can be configured to show a bitmap boot screen. (See: the Online C64 OS User's Guide → Chapter 10. Appendices → xiii. Boot Mode Customization.) The bitmap file used during boot-up is stored in the system directory's settings directory, and two file formats are supported; Art Studio (.art) for hi-res bitmaps, or Koala (.koa) for multi-color bitmaps.

Image Viewer makes it easy to save any bitmap as a new custom boot screen. Choose Save Boot Image from the File menu. The source file format is not important. If the image in memory is in the hi-res video mode, the image data is saved automatically to the correct place in the Art Studio format. If the image data is in the multi-color video mode, it is automatically saved as a Koala formatted file. In this way, if you have an image file you want to use as a custom boot screen but it's in some other format, such as InterPaint or Doodle, Image Viewer serves as an image file format converter.

You can even save individual frames from an animation, a 3D model or a panorama as a boot screen. When a multi-frame or matrix image is loaded, choosing Save Boot Image saves the currently visible frame. In this way, Image Viewer is able to extract still frames out of animations and 3D models.

Save any image as a custom boot screen.
Save any image as a custom boot screen

Extra options

Don't forget that, like in every other C64 OS Application, Utilities can be opened concurrently with Image Viewer. This allows you to write notes about images you care about in the Memos Utility, stash a reference to an image file in a Bucket for later processing, or open the Calculator to perform some math on the metadata. Among many other examples.

Utilities expand the features available to the Image Viewer Application, and the more Utilities you have installed, the more features Image Viewer can use.

Calculator calculating the number of pixels in this image.
Calculator calculating the number of pixels in this image

Utilities and the graphics buffer

Note that Utilities share a memory region with the graphics buffer. When a Utility is opened, the graphics data is moved from the graphics buffer to a generic place in memory. For this reason, the image cannot be viewed (either in split screen or full screen graphics modes) while a Utility is open.

When the Utility is closed, the image data is automatically restored to the graphics buffer.


Datatype loaders for multiple image formats

Image Viewer supports loading many image file formats, 17 file formats are listed below, and more are being added. Image file formats are not just hardcoded into the Application, but are supported by means of dynamically loadable, plugin, image datatype loaders.

The use of datatype loaders on the Commodore 64 is rare, and considered to be advanced functionality. The IDE64's built-in file manager has a system of plugins based on the filename extension. GoDot also, famously, has a system of datatype loaders, although the loader has to be selected and installed first, before you attempt to load images in that format.

Despite the existence of some software packages with plugin datatype loaders, those plugins are designed to work only in their particular program. The datatype loaders in C64 OS are designed to be usable by many different Applications that run on the C64 OS platform.

Image datatype loaders in C64 OS have several unique advantages:

  • The loader is dynamically looked up by the image's filename extension.
  • Loaders are global to the OS and can be used by any Application.
  • Loaders are runtime relocatable, letting them to fit into any other App's memory usage.
  • Loaders populate OS-level data structures that the gfx.lib and KERNAL understand.
  • Image loaders are only one type of a more general class of datatype loaders.

The following is a list of image datatype loaders and savers and where they are installed in the C64 OS system directory. When you try to open a file with a .cdu extension in Image Viewer, it searches the //os/library/loaders/ directory for a file called img.cdu.r and if it finds it, loads it in, and then uses it to load in the CDU-Paint graphic file.

The loader provides standardized metadata which Image Viewer displays, and populates graphics data structures that allow C64 OS to display the image data either in split screen or full screen graphics modes. A future version of Image Viewer will support custom display routines, provided by the loaders, for more CPU-intensive non-standard video modes, such as FLI and IFLI.

Item Item Description
//os/   C64 OS System Directory
library/   Application metadata file.
loaders/   Install location for datatype loaders.
img.3dk.r   3D Koala
img.art.r   Art Studio
img.cdu.r   CDU-Paint
img.cgx.r   Commodore Grafix
img.cwg.r   Create with Garfield
img.dd.r   Doodle
img.ddl.r   Doodle
img.hbm.r   Hi-res Bitmap
img.hbw.r   Hi-res Black & White
img.hed.r   Hi-Eddi
img.iph.r   InterPaint
img.ish.r   Image System (Hi-res)
img.kla.r   Koala Paint
img.koa.r   Koala Paint
img.ocp.r   Advanced Art Studio 2.0
img.pbot.r   PETSCII BOT
img.pet.r   C64 OS PETSCII format
img.pi.r   Blazing Paddles
img.rpm.r   RunPaint (Multi-color)
savers/   Install location for datatype savers.
img.art.r   Art Studio (Hi-res)
img.koa.r   Koala Paint (Multi-color)

Data savers work similarly to datatype loaders. There are fewer savers provided by C64 OS than loaders, so far. Savers, similarly, are installed in a savers subdirectory of the operating system's library directory, and can be invoked by any Application to write out graphic and other data in common file formats.

Through the use of datatype loaders and datatype savers, Image Viewer, and indeed any other C64 OS Application, can also be used for graphics file format conversion.

  1. A valid filename extension is 1 to 6 characters at the end of a filename, following a dot. Or, 1 to 6 characters at the beginning of a filename, preceding a dot.


Last modified: Feb 15, 2024