Image frames

createImage

createImage(x, y, width, height, ["name"]) -> string

Creates a new picture frame on the current page and returns its name. The coordinates are given in the current measurement units of the document. "name" should be a unique identifier for the object because you need this name for further access to that object. If "name" is not given Scribus will create one for you.

May raise NameExistsError if you explicitly pass a name that's already used.

getImageColorSpace

getImageColorSpace(["name"]) -> integer

Returns the color space for the image loaded in image frame "name" as one of following integer constants: CSPACE_RGB (0), CSPACE_CMYK (1), CSPACE_GRAY (2), CSPACE_DUOTONE (3) or CSPACE_MONOCHROME (4). Returns CSPACE_UNDEFINED (-1) if no image is loaded in the frame. If "name" is not given the currently selected item is used.

getImageFile

getImageFile(["name"]) -> string

Returns the filename for the image in the image frame. If "name" is not given the currently selected item is used.

getImageOffset

getImageOffset(["name"]) -> (x,y)

Returns a (x, y) tuple containing the offset values in point unit of the image frame "name". If "name" is not given the currently selected item is used.

getImageScale

getImageScale(["name"]) -> (x,y)

Returns a (x, y) tuple containing the scaling values of the image frame "name". If "name" is not given the currently selected item is used.

loadImage

loadImage("filename" [, "name"])

Loads the picture "picture" into the image frame "name". If "name" is not given the currently selected item is used.

May raise WrongFrameTypeError if the target frame is not an image frame

scaleImage

scaleImage(x, y [, "name"])

Sets the internal scaling factors of the picture in the image frame "name". If "name" is not given the currently selected item is used. A number of 1 means 100 %. Internal scaling factors are different from the values shown on properties palette. Note : deprecated, use setImageScale() instead.

May raise WrongFrameTypeError if the target frame is not an image frame

setImageBrightness

setImageBrightness(n [, "name"])

Set image brightness effect of the picture in the image frame "name". If "name" is not given the currently selected item is used. A number of 1 means 100 %. Brightness factor is equal to the value shown on properties palette.

May raise WrongFrameTypeError if the target frame is not an image frame

setImageGrayscale

setImageGrayscale(["name"])

Set image grayscale effect of the picture in the image frame "name". If "name" is not given the currently selected item is used.

May raise WrongFrameTypeError if the target frame is not an image frame

setImageOffset

setImageOffset(x, y [, "name"])

Sets the position of the picture in the image frame "name". If "name" is not given the currently selected item is used. The specified offset values are equal to the values shown on properties palette when point unit is used.

May raise WrongFrameTypeError if the target frame is not an image frame

setImageScale

setImageScale(x, y [, "name"])

Sets the scaling factors of the picture in the image frame "name". If "name" is not given the currently selected item is used. A number of 1 means 100 %. Scaling factors are equal to the values shown on properties palette.

May raise WrongFrameTypeError if the target frame is not an image frame

setScaleFrameToImage

setScaleFrameToImage([name])

Set frame size on the selected or specified image frame to image size.

May raise WrongFrameTypeError.

setScaleImageToFrame

setScaleImageToFrame(scaletoframe, proportional=None, name=<selection>)

Sets the scale to frame on the selected or specified image frame to 'scaletoframe'. If 'proportional' is specified, set fixed aspect ratio scaling to 'proportional'. Both 'scaletoframe' and 'proportional' are boolean.

May raise WrongFrameTypeError.

Constants

Image's color space

  • CSPACE_CMYK
  • CSPACE_DUOTONE
  • CSPACE_GRAY
  • CSPACE_MONOCHROME
  • CSPACE_RGB
  • CSPACE_UNDEFINED