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

background images blurry in export #1464

Open
moettinger opened this issue Mar 13, 2018 · 8 comments
Open

background images blurry in export #1464

moettinger opened this issue Mar 13, 2018 · 8 comments

Comments

@moettinger
Copy link

The content I am exporting looks sharp with good resolution before exporting but after exporting it using html2canvas, the parts of the content that are background images appear very blurry and pixelated. For both the top logo of "smarthernews" and the image of sunglasses at the bottom, I've tried various resolution images to no avail. No matter what, they come out blurry. They are both png's.

slideexport

@olecom
Copy link

olecom commented Mar 15, 2018

@moettinger do you use config option scale:
The scale to use for rendering. Defaults to the browsers device pixel ratio.?

https://html2canvas.hertzen.com/configuration

Making it scale: 2 and then Image Multiple Factor: 0.5 for viewing, works for me.

@moettinger
Copy link
Author

@olecom I don't see "Image Multiple Factor" as a config. Where do you see that?

@olecom
Copy link

olecom commented Mar 19, 2018

@moettinger

I don't see "Image Multiple Factor" as a config. Where do you see that?

That must be feature of your Viewer.

@michael2h4ng
Copy link

I've had the same issue. Using <img> instead of background-image worked for me. In my case, it had nothing to do with the scale option.

@xiaoTuiMao
Copy link

same issue.
change background-image to img can work success. but sometime i can't use img.
😭😭😭

@jonasborneland
Copy link

same issue here

@littlee
Copy link

littlee commented May 21, 2020

so frustrated 😭

this is my hack

<div style="position:relative; width:100px; height:200px;">
  <img src="./path/to/img.png" alt="" style="display:block; width:100%; height:100%;">
  <div style="position:absolute; top:0; left:0; width:100%; height:100%;">
    <!-- content above background -->
  </div>
</div>

@jayhoogle
Copy link

I was using background-image but had the same issue - it's only after searching for a while that I found this thread and have replaced it with an img component, which renders with much more clarity than the background-image did.

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

No branches or pull requests

7 participants