im_png2vips_header(3)

im_png2vips_header3

Convert png images to and from vips format

Part of im_png2vips(3).

Usage

#include <vips/vips.h>

int im_png2vips( const char *filename, IMAGE *out )

int im_png2vips_header( const char *filename, IMAGE *out )

int im_vips2png( IMAGE *in, const char *filename )

Overview

im_png2vips() reads the png image in filename, and writes the image out in VIPS format.

im_png2vips_header() reads just the header information from the PNG file. You can't read any pixels!

im_vips2png() reads the image in and writes a PNG file to the specified filename. The filename may include an optional mode string, following a ':' character, which you can use to specify compression and interlace.

The mode string has the following syntax:

<compression>,<interlace>

where <compression> is an integer between 0 and 9 specifying the amount of compression (6 is the default), and <interlace> is 0 for no interlace (this is the default) and 1 for ADAM7 interlace.

Beware that writing an interlaced image is potentially up to 7 times slower than writing a non-interlaced image.

The image is automatically converted to RGB or Monochrome (with an optional alpha channel) before saving.

Examples

The call:

im_vips2png fred.v fred.png

Writes a compression 6, uninterlaced PNG image.

im_vips2png fred.v fred.tif:,1

Writes an interlaced image.

Releases

3 releases since Debian 3.1 (Sarge); the text changed 1 time.

  1. 3.1–4.0
  2. 5.0

From libvips-dev 7.14.5-1 in Debian 5.0 (Lenny). Parsed by carta from the page's man source.