Skip to content

save()

Save the icon to a JPG or PNG file. Includes the Icon's background, if present (to remove the background before saving, use setColor() to set the background color to Color.CLEAR).

Parameters

Once an object icon has been created, you can use the following functions:

icon.save(filename)
icon.save(filename, width, height)
Parameter Type Default Description
filename str required The file to write, ending in ".jpg" or ".png".
width int or float None The width of the saved icon, in pixels. Defaults to the icon's current width.
height int or float None The height of the saved icon, in pixels. Defaults to the icon's current height.