Submodule extending the vtkImageActor object functionality.


class vedo.picture.Picture(obj=None)[source]

Bases: vtkRenderingCorePython.vtkImageActor, vedo.base.Base3DProp

Derived class of vtkImageActor. Used to represent 2D pictures. Can be instantiated with a path file name or with a numpy array.

Use Picture.shape to access the number of pixels in x and y.

rotateImage.py rotateImage.py


Set/get picture’s transparency.

blend(pic, alpha1=0.5, alpha2=0.5)[source]

Take L, LA, RGB, or RGBA images as input and blends them according to the alpha values and/or the opacity setting for each input.


Return an exact copy of the input Picture. If transform is True, it is given the same scaling and position.

crop(top=None, bottom=None, right=None, left=None)[source]

Crop picture.

  • top (float) – fraction to crop from the top margin

  • bottom (float) – fraction to crop from the bottom margin

  • left (float) – fraction to crop from the left margin

  • right (float) – fraction to crop from the right margin


Extract one component of the rgb image

fft(mode='magnitude', logscale=12, center=True)[source]

Fast Fourier transform of a picture.

  • logscale (float) – if non-zero, take the logarithm of the intensity and scale it by this factor.

  • mode (str) – either [magnitude, real, imaginary, complex], compute the point array data accordingly.

  • center (bool) – shift constant zero-frequency to the center of the image for display. (FFT converts spatial images into frequency space, but puts the zero frequency at the origin)


Return the underlying vtkImagaData object.


Mirror picture along x or y axis.


Resize the image by specifying the number of pixels in width and height. If left to zero, it will be automatically calculated to keep the original aspect ratio.


newsize (list) – shape of picture as [npx, npy]


Reverse Fast Fourier transform of a picture.

text(txt, pos=(0, 0, 0), s=1, c=None, alpha=1, bg=None, font='Theemim', dpi=500, justify='bottom-left')[source]

Build an image from a string.

threshold(value=None, flip=False)[source]

Create a polygonal Mesh from a Picture by filling regions with pixels luminosity above a specified value.

  • value (float, optional) – The default is None, e.i. 1/3 of the scalar range.

  • flip (bool, optional) – Flip polygon orientations


A polygonal mesh.

Return type



Convert an image to polygonal data (quads), with each polygon vertex assigned a RGBA value.


Write picture to file as png or jpg.