Method
VipsImagedzsave
Declaration [src]
int
vips_dzsave (
VipsImage* in,
const char* name,
...
)
Description [src]
Optional arguments:
basename: %gchar base part of namelayout:VipsForeignDzLayoutdirectory layout conventionsuffix: %gchar suffix for tilesoverlap: %gint set tile overlaptile_size: %gint set tile sizebackground:VipsArrayDoublebackground colourdepth:VipsForeignDzDepthhow deep to make the pyramidcentre: %gboolean centre the tilesangle:VipsAnglerotate the image by this muchcontainer:VipsForeignDzContainerset container typecompression: %gint zip deflate compression levelregion_shrink:VipsRegionShrinkhow to shrink each 2x2 regionskip_blanks: %gint skip tiles which are nearly equal to the backgroundid: %gchar id for IIIF propertiesQ: %gint, quality factor
Save an image as a set of tiles at various resolutions. By default dzsave
uses DeepZoom layout — use layout to pick other conventions.
vips_dzsave() creates a directory called name to hold the tiles. If name
ends .zip, vips_dzsave() will create a zip file called name to hold the
tiles. You can use container to force zip file output.
Use basename to set the name of the image we are creating. The
default value is set from name.
By default, tiles are written as JPEGs. Use Q set set the JPEG quality factor.
You can set suffix to something like ".png[bitdepth=4]" to write tiles
in another format.
In Google layout mode, edge tiles are expanded to tile_size by tile_size
pixels. Normally they are filled with white, but you can set another colour
with background. Images are usually placed at the top-left of the tile,
but you can have them centred by turning on centre.
You can set the size and overlap of tiles with tile_size and overlap.
They default to the correct settings for the selected layout. The deepzoom
defaults produce 256x256 jpeg files for centre tiles, the most efficient size.
Use depth to control how low the pyramid goes. This defaults to the
correct setting for the layout you select.
You can rotate the image during write with the angle argument. However,
this will only work for images which support random access, like openslide,
and not for things like JPEG. You’ll need to rotate those images
yourself with vips_rot(). Note that the autorotate option to the loader
may do what you need.
By default, all tiles are stripped since usually you do not want a copy of
all metadata in every tile. Set keep if you want to keep metadata.
If container is set to zip, you can set a compression level from -1
(use zlib default), 0 (store, compression disabled) to 9 (max compression).
If no value is given, the default is to store files without compression.
You can use region_shrink to control the method for shrinking each 2x2
region. This defaults to using the average of the 4 input pixels but you can
also use the median in cases where you want to preserve the range of values.
If you set skip_blanks to a value greater than or equal to zero, tiles
which are all within that many pixel values to the background are skipped.
This can save a lot of space for some image types. This option defaults to
5 in Google layout mode, -1 otherwise.
In IIIF layout, you can set the base of the id property in info.json
with id. The default is https://example.com/iiif.
Use layout #VIPS_FOREIGN_DZ_LAYOUT_IIIF3 for IIIF v3 layout.
See also: vips_tiffsave().
This method is not directly available to language bindings.