Sample-based thumbnailing built into libpng?

Andrew Klaassen <clawsoon-/[email protected]>
Newsgroups gmane.comp.graphics.png.general
Message-ID <[email protected]>
Hi,

I'm using ImageMagick to thumbnail many large JPEG and PNG files from a network drive.  I'm batching most of the thumbnail generation, but new files are being saved by artists constantly that may not be batch thumbnailed before they need to be viewed.  As a result, many images are being thumbnailed on-demand when the page loads.

For JPEG files, ImageMagick has an option ("-define jpeg:size={widthxheight}") which approximately triples my thumbnail generation speed, from about 3 seconds per 50MB image down to 1 second.  It works by sampling rows and columns of the image instead of reading the whole thing in.  This is very good.

I asked them whether the same thing would be possible with PNG files:

http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=31207&p=141920

...and they said that libjpeg supports this but: "The PNG library has no such option available."

A search through this mailing list was frustrated by Sourceforge error messages, but I did find this previous message from 2008 that touches on the topic:

https://sourceforge.net/p/png-mng/mailman/message/20296261/

I'm not sure from that message whether it's not possible to sample PNG files, or whether the poster thinks that it's not useful because decompression is too slow to make it worthwhile.  If it's decompression speed that was a problem, I wonder if that problem has been reduced by processor speedups over the past decade, and whether it might be worthwhile now.

And if it is worthwhile now - if there's not something fundamental about the PNG format that requires the whole file to be read in even if you only want a sample - would you folks be willing to consider this a feature request for libpng?

Thanks!

Andrew


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.