image_save()
Saves an image to a file.
Supports saving in `.jpg` and `.png` formats.
Syntax
planetcnc.image_save(image, filename)
Parameters
| Parameter | Type | Description | Comment |
| image | capsule | Image object capsule to be saved. | |
| filename | string | File path with `.jpg` or `.png` extension. | |
Return Value
boolean indicating success (`True` if saved successfully, `False` otherwise)
Raises exception on error
Examples
#! /usr/bin/env python
import planetcnc
# Assuming 'img' is a valid image capsule object
success = planetcnc.image_save(img, "output.png")
print("Image saved successfully:", success)
See also