---
name: "PS_open_image"
section: "3"
platform: "linux"
package: "pslib-dev"
version: "0.4.8-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/PS_open_image"
---

# PS\_open\_image(3)

Reads an image for later placement

## NAME

PS\_open\_image — Reads an image for later placement

## SYNOPSIS

\#include \<pslib.h\>

int PS\_open\_image(PSDoc \*psdoc, char \*type, char \*source, char \*data, int lenght, int width, int height, int components, int bpc, const char \*params)

## DESCRIPTION

Reads an image which is already available in memory. The parameter  **source** is currently not evaluated and assumed  to be \`memory'. The parameter **type** can be either  \`raw' or \`eps'. Images in raw format are expected to be a stream of pixels  starting in the upper left and ending in the lower right corner. Each  pixel is a tuple of components representing the colors. Each component  consists of **bpc** bit. Color imgags expect the  components to be stored in RGB or CMYK order. The number of components  implies the colorspace. 4 components imply a CMYK image and not an  RGB image with an alpha channel. This restriction may be removed in  later versions.

EPS images are expect as stored in a file. There is no need to  set any other paramter. The height und width of the image is  taken from the bounding box within the image data.

Since version 0.4.5 of pslib images are read by default for later  reuse. This means that the image is saved into a so called reusable  stream object. Later calls of **[PS\_place\_image(3)](/PS_place_image/3.md)** 			will only put a short  sequence of postscript code into the output file replaying the image.  This reduces the overall postscript file size, speeds up its processing by  the postscript rip and allows to place images into templates. This  behaviour can be turned off by setting the parameter \`imagereuse'  to false with **[PS\_set\_parameter(3)](/PS_set_parameter/3.md)**.

## RETURN VALUE

Returns identifier of the image or zero in case of an error.  The identifier is a positiv number greater 0.

## SEE ALSO

[PS\_open\_image\_file(3)](/PS_open_image_file/3.md), [PS\_place\_image(3)](/PS_place_image/3.md), [PS\_close\_image(3)](/PS_close_image/3.md)

## AUTHOR

This manual page was written by Uwe Steinmann uwe@steinmann.cx.
