Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thumbnail quality bad when scaled from rendered canvas #4921

Closed
CodingFabian opened this issue Jun 12, 2014 · 7 comments · Fixed by #4924
Closed

Thumbnail quality bad when scaled from rendered canvas #4921

CodingFabian opened this issue Jun 12, 2014 · 7 comments · Fixed by #4924

Comments

@CodingFabian
Copy link
Contributor

There are two mechanisms of thumbnail generation.
One takes the current canvas and resizes it,
the other generated the thumbnail directly.

Attached screenshot is on chrome 35 on macos with the online viewer and tracemonkey pdf.
You can see the highlighted pdf and the next have blockier look than the one before and after.
screen shot 2014-06-12 at 11 41 26

@CodingFabian
Copy link
Contributor Author

my working assumption right now is that for image quality the drawing should directly draw on two canvases, instead of copying and resizing the hig res canvas to a low res canvas afterwards.

@CodingFabian
Copy link
Contributor Author

yuck, passing in two canvas for drawing on seems to be not really doable for a newbie like me.
I tend to just disable the setImage() for thumbnail view, but on the other hand this would increase the rendering times of the thumbnails.

@CodingFabian CodingFabian changed the title Thumbnails look odd Thumbnail quality bad when scaled from rendered canvas Jun 12, 2014
@timvandermeij
Copy link
Contributor

Likely to be related: #2888

@CodingFabian
Copy link
Contributor Author

thanks @timvandermeij i assume its the same issue, but in #2888 there is no hint of where it comes from. I found it while i was looking into the slow canvas draw in chrome (caused by https://code.google.com/p/chromium/issues/detail?id=170021). I have a workaround for that, but first of all it should be figured out if downscaling is actually possible. right now i assume that it is not satisfying and we should figure out a way to render the pages two two different canvas

@CodingFabian
Copy link
Contributor Author

I was able to create a better result (with higher memory) by just copying the whole canvas to the thumbnail and letting the browser resize it.
this is the diff:
https://gist.github.com/CodingFabian/0a7c539c081c96538e6a
and this is the screenshot.
screen shot 2014-06-12 at 17 04 02

As you can see it looks better, but still not the same. directly drawing th the small canvas seems to produce a more light gray color.

@timvandermeij
Copy link
Contributor

Thank you for looking into this. I also think the overall thumbnail quality is pretty bad, not to mention that it looks even worse on hidpi displays. We should really find something for this, because even in your new screenshot, the page itself is difficult to recognize because of the downscale.

@yurydelendik
Copy link
Contributor

Here is my proposal #4924

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants