Loading and Saving Images
Let’s start simple load an image from disk.
Get some properties from it and save it back to a different name and location.
- Add the main module to your script.
import cvb
- Load an image that comes with a standard installation.
Note: lower case allows your script to run on Linux as well.
image = cvb.Image(cvb.install_path() + "/tutorial/Clara.png")
- Get the image dimensions.
print("Image Size: " + str(image.width) + " x " + str(image.height))
- Save it to your current location as BMP.
image.save("Clara.bmp")