andreasgal/pdf.js — Issue #653: thumbnail speed and quality improvements
Author: leeoniya
Created: 2011-10-11 15:36:23+00:00
State: open

the speed and quality of the thumbnails could use a good amount of improvement.

the speed is a tough one since the pages need to be processed in full to generate an accurate thumbnail (unless they are pre-made pngs, which is ideal IMO). it is a major drawback that thumbnails are generated on-the-fly rather than in the background - workers will improve this for sure, but i think idle detection can be implemented to make this work much better even without them.

the thumbnail quality could improve a lot. it is currently grainy and not great. judging from the behavior, i'm assuming the bulk of the time spent on generating thumbnails is on processing the page and not the actual canvas painting. i think if the thumbnails were rendered to an invisible canvas at 2x or even 4x their final size, then scaled down. the quality would be much more pleasant.

...and while we're at it, just generate the full-size page, cache it and downscale it for the thumbnail. so when the user needs to go to it, it's already in mem and doesn't need a second pass (as it appears to do now). the mem overhead should be minimal - 85% of pdfs (according to my gut) are black on white text content and should compress ridiculously well as a png.

i'd fork and try it out myself, but don't have too much time lately :(