Loading and resizing large images within Wikimedia projects has become faster and more reliable with the rollout of VipsScaler, a wraparound to the VIPS free image processing software. VIPS is a tool designed to use a small amount of memory when resizing images. This allows the wiki to create thumbnails of very large PNG files, something which previously was not possible because large amounts of memory would be required. And while Wikimedia Foundation technical staff rolled it out, a volunteer wrote the code.
The most common type of image file on the internet is a JPEG, but since its compression leads to deteriorated image quality with repeated editing, most Wikipedia and Wikimedia Commons non-photographic image files are stored in PNG formats, since it uses lossless compression. Until VipsScaler, thumbnails of PNG files larger than 50 megapixels could not be created.
Volunteer Bryan Tong Minh was a student at Delft University of Technology in 2008 when he initially wrote a utility capable of downscaling PNG images without using huge amounts of memory. Active on Wikimedia Commons at the time, Tong Minh (User:Bryan) said he “was annoyed by the fact that large PNGs did not have thumbnails because the image scaler that we used, ImageMagick, could not efficiently scale large non-JPEG images.”
During the review period of the utility, he became aware of VIPS, which allows for memory-efficient scaling of image files — more than just PNGs. He then set out to implement an extension that would allow usage of VIPS with MediaWiki, which became the VipsScaler extension.
“For many years, PNG files over a certain size could not be displayed on Wikipedia. They could be downloaded, but gave an error when thumbnailed and, on their file page, made it appear that the file was corrupt,” said Adam Cuerden, whose restoration work on Wikipedia since 2007 accounts for four percent of all featured pictures on English Wikipedia. Cuerden said it wasn’t uncommon for PNG files to be marked for deletion because they could not be displayed.
Currently, VIPS scales PNG images from 35 to 140 megapixels, according to Commons contributor Brian Wolff. He points to this 72 megapixel image below of Abraham Lincoln, restored by Adam Cuerden, as an example of an image that previously wouldn’t have been able to be rendered.
Wolff hopes eventually to be able to render TIFF images over 50 megapixels, as this is the format of many museum images. VipsScaler allows those museum large-size PNG files to be thumbnailed now.
“We originally planned deployment of VipsScaler in 2011,” said Tong Minh. “However, when testing the extension, it became apparent that the memory-scaling method that was the goal of implementing VipsScaler was not usable with PNGs. Fortunately by that time, the main developer of VIPS had become aware of our intentions to deploy VIPS on Wikimedia, and he implemented this efficient scaling method, which was the final obstacle to deployment of VIPS.”
Initially from the Netherlands, Tong Minh said he first found Wikipedia and the Wikimedia Foundation while “looking up information on Wikipedia back in 2006.” He previously wrote the GlobalUsage extension, which allows users to see which projects a Commons image is in use on, and he has made what he describes as “major and minor contributions to the MediaWiki core.”
Tong Minh believes that the 50 megapixels area limit for TIFF images will eventually be removed once TIFF scaling is moved to VIPS as well. “That should be nice for Wiki Loves Monuments,” said Sumana Harihareswara, Engineering Community Manager at the Wikimedia Foundation. . According to Harihareswara, there might be slight changes in visual quality and a few images might break.
Tong Minh said he hopes to have the opportunity to work on something “media related” in the future. As for the time it’s taken to reach deployment he wasn’t surprised. He said he recognizes that contributions are by volunteers and it can take “a lot of time to build up momentum. But when the momentum is there, eventually people are always very helpful in making the final push.”
(This effort could not have succeeded without the upstream efforts of John Cupitt, the VIPS developer who improved its scaling capabilities.)
Wikimedia Foundation Communications volunteer