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
RightforIG_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
trueorfalse, in any letter case. Leave the argument empty to toggle the current state. - Choice APIs accept a named value such as
Left,AutoZoom, orName. 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
1forIG_SetZoom(100%) or-1forIG_ViewByStep. - Color APIs accept a hex color in
#RGB,#RGBA,#RRGGBB, or#RRGGBBAAform, 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
| API | Description | Argument |
|---|---|---|
IG_OpenMainMenu | Open the main menu | – |
IG_OpenContextMenu | Open the viewer's right-click menu | – |
IG_OpenFolder | Open a folder (shows a folder picker) | – |
IG_OpenPath | Open a specific file or folder | A file or folder path (required) |
IG_OpenFile | Open a photo (shows a file picker) | – |
IG_NewWindow | Open the current image in a new window | – |
IG_OpenSettings | Open Settings | A 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_Exit | Exit ImageGlass | – |
File
| API | Description | Argument |
|---|---|---|
IG_Save | Save the current photo | – |
IG_SaveAs | Save the current photo as a new file | – |
IG_ExportImageFrames | Export the frames of a multi-frame image | – |
IG_OpenWith | Open the "Open with" dialog (Windows only) | – |
IG_Print | Print the current image (Windows only) | – |
IG_Share | Open the system Share dialog (Windows only) | – |
IG_OpenLocation | Show the current file in its folder | – |
IG_Rename | Rename the current file | – |
IG_Delete | Delete the current file | true = move to Recycle Bin (default), false = delete permanently |
IG_OpenProperties | Open the file's Properties dialog | – |
Navigation
| API | Description | Argument |
|---|---|---|
IG_ViewNext | View the next photo | – |
IG_ViewPrevious | View the previous photo | – |
IG_ViewByStep | Jump by a relative number of photos | A whole number (required), for example 1, -1, or 5 |
IG_ViewByIndex | View the photo at a position | A 0-based index (required) |
IG_Goto | Prompt for a position and jump to it | – |
IG_GotoFirst | View the first photo | – |
IG_GotoLast | View the last photo | – |
IG_ViewFrame | View a specific frame of a multi-frame image | A 0-based frame index (required) |
IG_ViewNextFrame | View the next frame | – |
IG_ViewPreviousFrame | View the previous frame | – |
IG_ViewFirstFrame | View the first frame | – |
IG_ViewLastFrame | View the last frame | – |
Zoom
| API | Description | Argument |
|---|---|---|
IG_ZoomIn | Zoom in | – |
IG_ZoomOut | Zoom out | – |
IG_CustomZoom | Prompt for a custom zoom level | – |
IG_SetZoom | Zoom to a specific factor | A number (required), where 1 = 100%, 2 = 200%, 0.5 = 50% |
IG_SetZoomForMouseClick | Zoom to 100%, or refresh if already at 100% | – |
IG_SetZoomMode | Set the zoom mode | One of AutoZoom, LockZoom, ScaleToWidth, ScaleToHeight, ScaleToFit, ScaleToFill (required) |
Panning
| API | Description | Argument |
|---|---|---|
IG_PanLeft | Pan left | – |
IG_PanRight | Pan right | – |
IG_PanUp | Pan up | – |
IG_PanDown | Pan down | – |
IG_PanToLeft | Pan to the left edge | – |
IG_PanToRight | Pan to the right edge | – |
IG_PanToTop | Pan to the top edge | – |
IG_PanToBottom | Pan to the bottom edge | – |
Image
| API | Description | Argument |
|---|---|---|
IG_Refresh | Refresh the view | – |
IG_Reload | Reload the current file | true = reset zoom (default), false = keep zoom |
IG_ReloadList | Reload the image list | – |
IG_Unload | Unload the current photo | – |
IG_ToggleExplorerSortOrder | Match File Explorer's sort order | true / false; omit to toggle |
IG_SetLoadingOrderBy | Set the sort field | One of Name, Random, FileSize, Extension, DateCreated, DateAccessed, DateModified, ExifDateTaken, ExifRating (required) |
IG_SetLoadingOrderType | Set the sort direction | Asc or Desc (required) |
IG_SetColorChannels | Show only certain color channels | One of R, G, B, A, RGB, RGBA, RA, GA, BA, or a comma-separated combination such as R, B (required) |
IG_OpenEditingApp | Open the image in the configured editor | – |
IG_InvertColors | Invert the image colors | – |
IG_ToggleImageAnimation | Play or pause an animated image | true = play, false = pause; omit to toggle |
IG_Rotate | Rotate the image | Left or Right (required) |
IG_FlipImage | Flip the image | Horizontal or Vertical (required) |
IG_SetDesktopBackground | Set the image as the desktop wallpaper | – |
IG_SetLockScreenImage | Set the image as the lock screen (Windows only) | – |
Clipboard
| API | Description | Argument |
|---|---|---|
IG_PasteImage | Paste an image or file path from the clipboard | – |
IG_CopyImagePixels | Copy the image pixels to the clipboard | – |
IG_CopyImagePath | Copy the file path to the clipboard | – |
IG_CopyFiles | Copy the current file to the clipboard | – |
IG_CutFiles | Cut the current file to the clipboard | – |
IG_ClearClipboard | Clear the clipboard | – |
Window Modes
| API | Description | Argument |
|---|---|---|
IG_ToggleWindowFit | Toggle Window Fit mode | true / false; omit to toggle |
IG_ToggleFrameless | Toggle frameless mode (not available on Linux) | true / false; omit to toggle |
IG_ToggleFullScreen | Toggle full-screen mode | true / false; omit to toggle |
IG_ToggleSlideshow | Start or stop the slideshow | true = start, false = stop; omit to toggle |
IG_ToggleSlideshowPlayback | Pause or resume the running slideshow | – |
IG_ToggleSlideshowCountdown | Show or hide the slideshow countdown | true / false; omit to toggle |
Layout
| API | Description | Argument |
|---|---|---|
IG_ToggleToolbar | Show or hide the toolbar | true / false; omit to toggle |
IG_ToggleGallery | Show or hide the gallery | true / false; omit to toggle |
IG_ToggleCheckerboard | Set the checkerboard background | None, Client, or Image; omit to cycle |
IG_ToggleWindowTopMost | Toggle always-on-top | true / false; omit to toggle |
IG_SetBackgroundColor | Set the viewer background color | A hex color such as #1e1e1e; omit to open the color picker |
💡 While a slideshow is running,
IG_SetBackgroundColorchanges the slideshow background color instead of the normal viewer background.
Tools
| API | Description | Argument |
|---|---|---|
IG_ToggleTool | Open or close a tool | A tool ID (required), for example Tool_ColorPicker |
IG_OpenTool | Open a tool | A tool ID (required) |
IG_CloseTool | Close a specific tool | A tool ID (required) |
IG_CloseCurrentTool | Close 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
| API | Description | Argument |
|---|---|---|
IG_OpenAboutWindow | Open the About window | – |
IG_ManageLicense | Open the Pro license window: upgrade when unlicensed, manage an activated license | – |
IG_CheckForUpdate | Check for updates | true = show the update window (default), false = check silently |
IG_ReportIssue | Open the issue tracker in the browser | – |
IG_QuickSetup | Open the Quick Setup wizard | – |
IG_SetDefaultPhotoViewer | Register ImageGlass as the default photo viewer (Windows only) | – |
IG_RemoveDefaultPhotoViewer | Unregister ImageGlass as the default photo viewer (Windows only) | – |
IG_SetFileWatcher | Watch 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, andIG_RemoveDefaultPhotoViewerare Windows only, andIG_ToggleFramelessis not available on Linux. Running one where it is unavailable shows a "not supported" message instead. - Edition:
IG_SetFileWatcherand theTool_HdrToneMappertool 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, andIG_Exit. See ImageGlass Tools.