Getting Started with CVBpy

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.

  1. Add the main module to your script.
import cvb
  1. 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")
  1. Get the image dimensions.
print("Image Size: " + str(image.width) + " x " + str(image.height))
  1. Save it to your current location as BMP.
image.save("Clara.bmp")
2 Likes