Creating Pyramidal Tiled TIFFs with vips and Comparing Compression Methods

Introduction To comfortably view high-resolution images on the web, pyramidal structures (multiple resolutions) and tile segmentation are essential. In this article, we used vips to create pyramidal tiled TIFFs from JPEG2000 images and compared the file sizes of various compression methods. Test Environment vips 8.17.3 macOS (darwin) Source image: 764029-1.jp2 (274MB) Source: National Archives of Japan Digital Archive vips Commands JPEG Compression (Lossy) # v # v # v i i i Q p Q p Q p u s u s u s a a a l t l t l t i i i i i i t f t f t f y f y f y f s s s 1 a 7 a 2 a 0 v 5 v 5 v 0 e e e ( ( ( i b i h i n n a n i n e p l p g p a u a u h u r t n t t l . c . c . y j e j o j p d p m p l 2 ) 2 p 2 o r s o o e o s u u s u l t t s t e p p i p s u u o u s t t n t ) _ _ ) _ q q q 1 7 2 0 5 5 0 . . . t t t i i i f f f - - - t t t i i i l l l e e e - - - p p p y y y r r r a a a m m m i i i d d d - - - c c c o o o m m m p p p r r r e e e s s s s s s i i i o o o n n n = = = j j j p p p e e e g g g - - - Q Q Q = = = 7 2 1 5 5 0 0 Lossless Compression # v # v # v i i i D p L p U p e s Z s n s f W c l t t o t a i c i m i t f o f p f e f m f r f s p s e s c a r a s a o v e v s v m e s e e e p s d r i i i i e n o n ( n s p n p B p s u u i u i t t g t o . . T . n j j I j p p F p ( 2 2 F 2 z l o o f o i u u o u b t t r t ) p p m p u u a u t t t t _ _ _ d l r n e z e o f w q n l . u e a t i . t i r t e f e i . d f t i - i f t f - i t l i - e v l t e e i r l - e p 4 - y G p r B y - a ) r p m a y i m r d i a d m i - d c - o c m o - p m c r p o e r m s e p s s r i s e o i s n o s = n i l = o z n n w o = n d e e f l - a b t i e g t i f f Test Results File Compression Method Size Ratio to Original Notes Original JPEG2000 274MB - Input q25.tif JPEG Q=25 57MB 0.21x Lossy, high compression q75.tif JPEG Q=75 167MB 0.61x Lossy, balanced q100.tif JPEG Q=100 2.4GB 8.8x Lossy, high quality deflate.tif Deflate 2.8GB 10.2x Lossless lzw.tif LZW 3.2GB 11.7x Lossless none.tif Uncompressed 4.3GB 15.7x Lossless Image Quality Comparison We visually compared the differences in JPEG compression quality (from left: Q=25, Q=75, Q=100). ...

November 29, 2025 · 5 min · Nakamura

Cases Where ImageMagick May Not Work Properly for Creating Pyramidal TIFFs?

Overview I investigated cases where ImageMagick does not work properly when creating pyramidal TIFFs for IIIF image delivery. References Conversion methods are explained on pages like the following. https://samvera.github.io/serverless-iiif/docs/source-images#creating-tiled-tiffs Using the VIPS command line # v # v i i F p F p & & o s o s & & r r t e v r a i a x i m f t p 3 f s r s t - s o a e c a u c t m h v r t i p a e c _ f _ n e b f i n s a s m e o i n a a l u m d v g r a e e s c g s . o e e o t v u _ u e r i w r m c m i c p e a t e _ g h _ i i e i m m . a m a a t n a g g i g e e f a e . l . v o p t u h i o t a f u p t u c t p t h e u _ a m t i n p _ m n _ i a e i m g l m a e a g . g e t e . i . t f v i f 0 - t - i - t l n i e l 3 e - \ p - y p r y a r m a i m d i d - c - o c m o p m r p e r s e s s i s o i n o n j p j e p g e g - t - i t l i e l - e w - i w d i t d h t h 2 5 2 6 5 6 - t - i t l i e l - e h - e h i e g i h g t h t 2 5 2 6 5 6 \ Using ImageMagick c o n - - - ' v d d c p e e e o t r f f m i t i i p f n n r : s e e e o o s u u t t s t r i i p c f f j u e f f p t _ : : e _ i t g g i m i e m a l n \ a g e e g e - r e . g a . t e t t i o e i f m - f e p ' - t y a r r l y a p = m h 2 i a 5 d 6 s o x = f 2 t f 5 r 6 u e Target Data The following image was used. ...

March 11, 2025 · 19 min · Nakamura

How to Use pyvips and Create Pyramid Tiled TIFF Files

Overview I created a program to generate Pyramid Tiled TIFF files using pyvips. You can try it on the following Google Colab. https://colab.research.google.com/drive/1VO1PgKgS3H21zXpg4g2inN-mtIrON5TQ?usp=sharing When delivering images via IIIF, there are situations where Pyramid Tiled TIFF files need to be created. We hope this is helpful for image conversion using Python and Vips. The parameters are based on the following. https://github.com/samvera-labs/serverless-iiif#using-vips Also, as one example of how to deliver converted Pyramid Tiled TIFF files, the following article may also be helpful. ...

March 30, 2022 · 2 min · Nakamura