Documentation

App APIs

A reference for every ImageGlass API, and the built-in commands behind shortcuts, custom tools, and integrations.

Every feature in ImageGlass is powered by a built-in API (also called a command). Each API has an identifier such as IG_ViewNext, and you can bind APIs to custom toolbar buttons, mouse click actions, and tools to tailor ImageGlass to your workflow.

Some APIs accept an argument that customizes what they do, for example IG_Rotate with Left or Right.

How to Use an API

Wherever you assign an API in Settings, you fill in two fields:

  • Executable: the API identifier, for example IG_ViewNext.
  • Argument: an optional value that customizes the API, for example Right for IG_Rotate.

A live preview updates as you type. You can bind APIs in these places:

  • Custom toolbar buttons: Settings > Toolbar
  • Mouse click actions: Settings > Mouse – an ImageGlass Pro feature ⭐
  • Tools: Settings > Tools – create a tool that runs an ImageGlass API, launches an executable file, or starts an external app built with the ImageGlass SDK

💡 Settings > Keyboard lists the built-in menu items and lets you change their shortcut keys. It does not change which API a menu item runs; to trigger a specific API, add a toolbar button, mouse action, or tool.

💡 If the Executable is not a built-in API, ImageGlass runs it as an external program instead, so the same field can also launch other apps. In that case the Argument is passed on as the program's command line, and <file> is replaced with the path of the photo you are viewing – for example --input <file>.

Passing Arguments

An API reads its argument as plain text. The expected format depends on the API:

  • Toggle APIs (show/hide, on/off) accept true or false, in any letter case. Leave the argument empty to toggle the current state.
  • Choice APIs accept a named value such as Left, AutoZoom, or Name. Spell it exactly as it appears in the tables below, because the app matches these names letter for letter.
  • Number APIs accept a number, such as 1 for IG_SetZoom (100%) or -1 for IG_ViewByStep.
  • Color APIs accept a hex color in #RGB, #RGBA, #RRGGBB, or #RRGGBBAA form, for example #1e1e1e, #f0f, or #1e1e1e80. Note that the alpha value comes last.
  • Path APIs accept a file or folder path.
  • Tool APIs accept a tool ID such as Tool_ColorPicker.

For example, a toolbar button that rotates right uses the Executable IG_Rotate and the Argument Right. A button that deletes the current file permanently uses IG_Delete with false.

API Reference

APIs whose argument is listed as ignore any argument.

General

APIDescriptionArgument
IG_OpenMainMenuOpen the main menu
IG_OpenContextMenuOpen the viewer's right-click menu
IG_OpenFolderOpen a folder (shows a folder picker)
IG_OpenPathOpen a specific file or folderA file or folder path (required)
IG_OpenFileOpen a photo (shows a file picker)
IG_NewWindowOpen the current image in a new window
IG_OpenSettingsOpen SettingsA page name: General, Image, Slideshow, Edit, Layout, Viewer, Toolbar, Gallery, Mouse, Keyboard, FileAssociations, Tools, Plugins, Language, Appearance. A setting key such as EnableFileWatcher opens its page and scrolls to that setting. Omit to reopen the last page
IG_ExitExit ImageGlass

File

APIDescriptionArgument
IG_SaveSave the current photo
IG_SaveAsSave the current photo as a new file
IG_ExportImageFramesExport the frames of a multi-frame image
IG_OpenWithOpen the "Open with" dialog (Windows only)
IG_PrintPrint the current image (Windows only)
IG_ShareOpen the system Share dialog (Windows only)
IG_OpenLocationShow the current file in its folder
IG_RenameRename the current file
IG_DeleteDelete the current filetrue = move to Recycle Bin (default), false = delete permanently
IG_OpenPropertiesOpen the file's Properties dialog
APIDescriptionArgument
IG_ViewNextView the next photo
IG_ViewPreviousView the previous photo
IG_ViewByStepJump by a relative number of photosA whole number (required), for example 1, -1, or 5
IG_ViewByIndexView the photo at a positionA 0-based index (required)
IG_GotoPrompt for a position and jump to it
IG_GotoFirstView the first photo
IG_GotoLastView the last photo
IG_ViewFrameView a specific frame of a multi-frame imageA 0-based frame index (required)
IG_ViewNextFrameView the next frame
IG_ViewPreviousFrameView the previous frame
IG_ViewFirstFrameView the first frame
IG_ViewLastFrameView the last frame

Zoom

APIDescriptionArgument
IG_ZoomInZoom in
IG_ZoomOutZoom out
IG_CustomZoomPrompt for a custom zoom level
IG_SetZoomZoom to a specific factorA number (required), where 1 = 100%, 2 = 200%, 0.5 = 50%
IG_SetZoomForMouseClickZoom to 100%, or refresh if already at 100%
IG_SetZoomModeSet the zoom modeOne of AutoZoom, LockZoom, ScaleToWidth, ScaleToHeight, ScaleToFit, ScaleToFill (required)

Panning

APIDescriptionArgument
IG_PanLeftPan left
IG_PanRightPan right
IG_PanUpPan up
IG_PanDownPan down
IG_PanToLeftPan to the left edge
IG_PanToRightPan to the right edge
IG_PanToTopPan to the top edge
IG_PanToBottomPan to the bottom edge

Image

APIDescriptionArgument
IG_RefreshRefresh the view
IG_ReloadReload the current filetrue = reset zoom (default), false = keep zoom
IG_ReloadListReload the image list
IG_UnloadUnload the current photo
IG_ToggleExplorerSortOrderMatch File Explorer's sort ordertrue / false; omit to toggle
IG_SetLoadingOrderBySet the sort fieldOne of Name, Random, FileSize, Extension, DateCreated, DateAccessed, DateModified, ExifDateTaken, ExifRating (required)
IG_SetLoadingOrderTypeSet the sort directionAsc or Desc (required)
IG_SetColorChannelsShow only certain color channelsOne of R, G, B, A, RGB, RGBA, RA, GA, BA, or a comma-separated combination such as R, B (required)
IG_OpenEditingAppOpen the image in the configured editor
IG_InvertColorsInvert the image colors
IG_ToggleImageAnimationPlay or pause an animated imagetrue = play, false = pause; omit to toggle
IG_RotateRotate the imageLeft or Right (required)
IG_FlipImageFlip the imageHorizontal or Vertical (required)
IG_SetDesktopBackgroundSet the image as the desktop wallpaper
IG_SetLockScreenImageSet the image as the lock screen (Windows only)

Clipboard

APIDescriptionArgument
IG_PasteImagePaste an image or file path from the clipboard
IG_CopyImagePixelsCopy the image pixels to the clipboard
IG_CopyImagePathCopy the file path to the clipboard
IG_CopyFilesCopy the current file to the clipboard
IG_CutFilesCut the current file to the clipboard
IG_ClearClipboardClear the clipboard

Window Modes

APIDescriptionArgument
IG_ToggleWindowFitToggle Window Fit modetrue / false; omit to toggle
IG_ToggleFramelessToggle frameless mode (not available on Linux)true / false; omit to toggle
IG_ToggleFullScreenToggle full-screen modetrue / false; omit to toggle
IG_ToggleSlideshowStart or stop the slideshowtrue = start, false = stop; omit to toggle
IG_ToggleSlideshowPlaybackPause or resume the running slideshow
IG_ToggleSlideshowCountdownShow or hide the slideshow countdowntrue / false; omit to toggle

Layout

APIDescriptionArgument
IG_ToggleToolbarShow or hide the toolbartrue / false; omit to toggle
IG_ToggleGalleryShow or hide the gallerytrue / false; omit to toggle
IG_ToggleCheckerboardSet the checkerboard backgroundNone, Client, or Image; omit to cycle
IG_ToggleWindowTopMostToggle always-on-toptrue / false; omit to toggle
IG_SetBackgroundColorSet the viewer background colorA hex color such as #1e1e1e; omit to open the color picker

💡 While a slideshow is running, IG_SetBackgroundColor changes the slideshow background color instead of the normal viewer background.

Tools

APIDescriptionArgument
IG_ToggleToolOpen or close a toolA tool ID (required), for example Tool_ColorPicker
IG_OpenToolOpen a toolA tool ID (required)
IG_CloseToolClose a specific toolA tool ID (required)
IG_CloseCurrentToolClose the active tool

Built-in tool IDs: Tool_ColorPicker, Tool_CropImage, Tool_FrameNav, Tool_HdrToneMapper, Tool_ImageResizer, Tool_LosslessCompression.

Tool_HdrToneMapper is an ImageGlass Pro tool ⭐. On Classic it opens as a read-only preview, so you can see what it does before upgrading.

Help and Maintenance

APIDescriptionArgument
IG_OpenAboutWindowOpen the About window
IG_ManageLicenseOpen the Pro license window: upgrade when unlicensed, manage an activated license
IG_CheckForUpdateCheck for updatestrue = show the update window (default), false = check silently
IG_ReportIssueOpen the issue tracker in the browser
IG_QuickSetupOpen the Quick Setup wizard
IG_SetDefaultPhotoViewerRegister ImageGlass as the default photo viewer (Windows only)
IG_RemoveDefaultPhotoViewerUnregister ImageGlass as the default photo viewer (Windows only)
IG_SetFileWatcherWatch the current folder for changes – an ImageGlass Pro feature ⭐true = enable, false = disable; omit to disable

Availability Notes

  • Platform: a few APIs depend on the operating system, as marked in the tables above. IG_OpenWith, IG_Print, IG_Share, IG_SetLockScreenImage, IG_SetDefaultPhotoViewer, and IG_RemoveDefaultPhotoViewer are Windows only, and IG_ToggleFrameless is not available on Linux. Running one where it is unavailable shows a "not supported" message instead.
  • Edition: IG_SetFileWatcher and the Tool_HdrToneMapper tool belong to ImageGlass Pro ⭐. Everything else in this reference works in ImageGlass Classic.
  • Locked features: an administrator can disable individual APIs on a managed machine. A locked API disappears from the menus and does nothing when a shortcut, toolbar button, or tool tries to run it. See Lock Features in the Configuration Files guide.
  • External tools: an external app built with the ImageGlass SDK can communicate with ImageGlass to run APIs. For security, it can run only a subset of them. The following APIs are blocked over the SDK connection: IG_Delete, IG_Rename, IG_Save, IG_SaveAs, IG_NewWindow, IG_OpenWith, IG_OpenEditingApp, IG_SetDesktopBackground, IG_SetLockScreenImage, IG_SetDefaultPhotoViewer, IG_RemoveDefaultPhotoViewer, and IG_Exit. See ImageGlass Tools.