cvb.Image.from_images() not giving expected output

Hi there!

I found the from_images() function in the cvbpy documentation and tried a simple implementation of it, but i can’t get it to work. It just returns the first image from the list.

Additionally I’m wondering if its possible to create an cvb.Image object from a numpy array?

Im working with:

  • platform: Windows 10
  • python version: 3.8.8
  • CVB version: 13.03.002
	    file_name = "Clara.png"
	    file_name_out = "Clara_dual.png"
	    path = os.path.join(PATH_MEDIA, "container", file_name)
	    path_out = os.path.join(PATH_MEDIA, "container", file_name_out)

	    src_image = cvb.Image(path)
	    double_image = src_image.from_images(0, [src_image, src_image])  # this will just be the first image

Hi @Swaab,

Question 1: What image manipulation do you aim to implement?
I can guess you want the two images side-by-side . that would be the result of


Question 2: You can get the cvb.Image from an numpy.ndarray

import numpy as np
import cvb
nparray = np.ones((2,2))
image = cvb.WrappedImage.from_buffer(nparray)

(in this sample for a 2x2 image of ones.)

1 Like

Q1: Yes side by side indeed! Ill check your function later this week, but that oughta do it
Q2: Perfect!