The name of the image, or null if not set.
The size of the image. Setting this resizes the image in place to the exact dimensions.
Whether the image is a template image.
Template images are tinted by the system to match the appearance context (e.g. menu bar icons).
Save the image to a file
Destination file path (extension determines format: png, jpg, tiff, bmp, gif)
true if saved successfully, false otherwise
Replace this image's content.
If this image is bound to a UI element, the canvas re-renders automatically.
A file path string (~ is expanded) or another HSImage object
StaticfromLoad an app's icon by bundle identifier
Bundle identifier of the application
OptionalwithFallbackSymbol: string
The name of an SF Symbol to use if no bundle image could be loaded. Defaults to questionmark.circle
An HSImage object, or null if the app couldn't be found
StaticfromLoad a system image by name
Name of the system image (e.g., "NSComputer", "NSFolder")
An HSImage object, or null if the image couldn't be found
StaticfromLoad an image from a file path
Path to the image file
An HSImage object, or null if the file couldn't be loaded
StaticfromLoad a system symbol by name
Name of the symbol (e.g., "hammer", "questionmark.circle")
An HSImage object, or null if the symbol couldn't be found
StaticfromLoad an image from a URL (asynchronous)
URL string of the image
A Promise that resolves to the loaded image, or rejects on error
StaticiconGet the icon for a file
Path to the file
An HSImage object representing the file's icon
StaticiconGet the icon for a file type
File extension or UTI (e.g., "png", "public.png")
An HSImage object representing the file type's icon
Bridge type for working with images in JavaScript
HSImage provides a comprehensive API for loading, manipulating, and saving images. It supports various image sources including files, system icons, app bundles, and URLs.
Loading Images
Image Manipulation