image_size()

Returns the size and number of color channels of an image.

Retrieves the width, height, and number of channels based on the image format.
Channels:

Syntax

planetcnc.image_size(image)

Parameters

Parameter Type Description Comment
image capsule Image object capsule.

Return Value

Examples

#! /usr/bin/env python
 
import planetcnc
 
# Assuming 'img' is a valid image capsule object
width, height, channels = planetcnc.image_size(img)
print(f"Image size: {width}x{height}, Channels: {channels}")

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