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

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

image_open
image_open_data
image_close
image_save
image_size
image_get_pixel
image_get_pixel_gray
image_to_cam
image_from_cam