Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A fast image processing library with low memory needs.

License

NotificationsYou must be signed in to change notification settings

libvips/libvips

Repository files navigation

CIFuzzing StatusCoverity StatusGitter

Introduction

libvips is ademand-driven, horizontallythreadedimage processing library. Compared to similarlibraries,libvips runs quickly and uses littlememory.libvips is licensed under theLGPL-2.1-or-later.

It has around300operationscovering arithmetic, histograms, convolution, morphologicaloperations, frequency filtering, colour, resampling,statistics and others. It supports a large range ofnumerictypes,from 8-bit int to 128-bit complex. Images can have any number of bands.It supports a good range of image formats, including JPEG, JPEG 2000, JPEG XL,TIFF, PNG, WebP, HEIC, AVIF, FITS, Matlab, OpenEXR, PDF, SVG, HDR, PPM / PGM /PFM, CSV, GIF, Analyze, NIfTI, DeepZoom, and OpenSlide. It can also loadimages via ImageMagick or GraphicsMagick, letting it work with formatslike DICOM.

It comes with bindings forC,C++,and thecommand-line.Full bindings are available for :

LanguageBinding
Rubyruby-vips
Pythonpyvips
PHPphp-vips
C# / .NETNetVips
Gogovips,vips-gen
Lualua-vips
Crystalcrystal-vips
Elixirvix
JVMvips-ffm

libvips is used as an image processing engine by:

sharp (on node.js)
imgproxy
bimg
sharp for Go
Ruby on Rails
CarrierWave
mediawiki
PhotoFlow
JVips

and others. The official libvips GUI isnip2, a strange combination of aspreadsheet and a photo editor.

Install

There are packages for most Unix-like operating systems, includingmacOS. Check your package manager.

There are binaries for Windows inreleases.

Thelibvips website hasdetailedinstall notes.

Building from source

libvips uses theMeson build system, version 0.56or later. Meson can useninja, Visual Studio orXCode as a backend, so you'll also need one of them.

libvips must havebuild-essential,pkg-config,libglib2.0-dev,libexpat1-dev. See theDependencies section below for a full listof the libvips optional dependencies.

There are basic bash completions incompletions/, see the README in there.

Cheatsheet

cd libvips-x.y.xmeson setup build --prefix /my/install/prefixcd buildmeson compilemeson testmeson install

Check the output ofmeson setup carefully and make sure it found everythingyou wanted it to find. Add arguments tomeson setup to change the buildconfiguration.

  • Add flags like-Dnsgif=false to turn libvips options on and off, seemeson_options.txt for a list of all the build options libvips supports.

  • Add flags like-Dmagick=disabled to turn libvips dependencies on and off,seemeson_options.txt and the list below for a summary of all the libvipsdependencies.

  • You might need to add--libdir lib on Debian if you don't want the archname in the library path.

  • Add--default-library static for a static build.

  • Use e.g.CC=clang CXX=clang++ meson setup ... to change compiler.

  • You can have an alternative build directory, pick whatever names you like,for example one for release and one for debug.

There's a more comprehensive test suite you can run once libvips has beeninstalled. Usepytest in the libvips base directory.

Optional dependencies

If suitable versions are found, libvips will add support for the followinglibraries automatically. Packages are generally found withpkg-config,so make sure that is working.

libjpeg

Anything that is compatible with the IJG JPEG library. Usemozjpeg if youcan. Another option islibjpeg-turbo.

libexif

If available, libvips adds support for EXIF metadata in JPEG files.

librsvg

The usual SVG loader. If this is not present, vips will try to load SVGsvia imagemagick instead.

PDFium

If present, libvips will attempt to load PDFs with PDFium. Download theprebuilt pdfium binary from:

https://github.com/bblanchon/pdfium-binaries

Untar to the libvips install prefix, for example:

cd ~/vipstar xf ~/pdfium-linux.tgz

Create apdfium.pc like this (update the version number):

VIPSHOME=/home/john/vipscat > $VIPSHOME/lib/pkgconfig/pdfium.pc << EOF     prefix=$VIPSHOME     exec_prefix=\${prefix}     libdir=\${exec_prefix}/lib     includedir=\${prefix}/include     Name: pdfium     Description: pdfium     Version: 4290     Requires:     Libs: -L\${libdir} -lpdfium     Cflags: -I\${includedir}EOF

If PDFium is not detected, libvips will look forpoppler-glib instead.

poppler-glib

The Poppler PDF renderer, with a glib API. If this is not present, vipswill try to load PDFs via imagemagick.

cgif

If available, libvips will save GIFs withcgif. If this is not present, vips willtry to save gifs via imagemagick instead.

libarchive

If available, libvips adds support for creating image pyramids withdzsave.

libtiff

The TIFF library. It needs to be built with support for JPEG andZIP compression. 3.4b037 and later are known to be OK.

fftw3

If libvips finds this library, it uses it for fourier transforms.

lcms2

If present,vips_icc_import(),vips_icc_export() andvips_icc_transform()can be used to manipulate images with ICC profiles.

libspng

If present, libvips will load and save PNG files using libspng. If not, itwill look for the standard libpng package.

libimagequant, quantizr

If one of these quantisation packages is present, libvips can write 8-bitpalette-ised PNGs and GIFs.

ImageMagick, or optionally GraphicsMagick

If available, libvips adds support for loading and saving alllibMagick-supported image file types. You can enable and disable load and saveseparately.

Imagemagick 6.9+ needs to have been built with--with-modules. Most packagedIMs are, I think.

If you are going to be using libvips with untrusted images, perhaps in aweb server, for example, you should consider the security implications ofenabling a package with such a large attack surface.

pangocairo

If available, libvips adds support for text rendering. You need thepackage pangocairo inpkg-config --list-all.

highway

If present, libvips will accelerate some operations with SIMD. If not, itwill look for the orc-0.4 package.

matio

If available, vips can load images from Matlab save files.

cfitsio

If available, vips can load FITS images.

libwebp

If available, vips can load and save WebP images.

libniftiio

If available, vips can load and save NIfTI images.

OpenEXR

If available, libvips will directly read (but not write, sadly)OpenEXR images.

OpenJPEG

If available, libvips will read and write JPEG2000 images.

libjxl

If available, libvips will read and write JPEG-XL images.

OpenSlide

If available, libvips can load OpenSlide-supported virtual slidefiles: Aperio, Hamamatsu, Leica, MIRAX, Sakura, Trestle, and Ventana.

libheif

If available, libvips can load and save HEIC and AVIF images. Your libheif (inturn) needs to be built with the correct decoders and encoders. You can checkwith eg.:

$heif-convert --list-decodersHEIC decoders:- libde265 = libde265 HEVC decoder, version 1.0.9AVIF decoders:- dav1d = dav1d v6.6.0- aom = AOMedia Project AV1 Decoder v3.5.0$heif-enc --list-encodersHEIC encoders:- x265 = x265 HEVC encoder (3.5+1-f0c1022b6) [default]AVIF encoders:- aom = AOMedia Project AV1 Encoder v3.5.0 [default]- svt = SVT-AV1 encoder v1.1.0- rav1e = Rav1e encoder

Contributors

Code Contributors

This project exists thanks to all the people who contribute.

Organizations

We've had generous financial support from our sponsors. Thank you very much!

Sponsor this project

    Packages

    No packages published

    Contributors115

    Languages


    [8]ページ先頭

    ©2009-2025 Movatter.jp