CImage:PixelType (replaces Datatype)
The PixelType method returns the pixel type of image pixels as a numeric code. The pixel type refers to the value representation stored in the pixel (integer, real, etc.).
nCode = CImage:PixelType() |
where the number nCode is the Mira pixel type code (see Remarks).
The pixel type returned by this method is defined in the Pixel Types table. You can also use the PixelTypeStr method to retrieve the pixel type name as a string.
Suppose the file sPath contains an image with "long" (32 bit integer) pixels. The following script prints the pixel type of the image:
|
-- Create a CImage |
|
-- Open the image from file path sPath. |
|
-- retrieve the numeric pixel type |
|
-- result: Pixel Type = 4 |
|
-- delete the CImage from memory |
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.