0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

modern-screenshotで画質が低い時の対処法

Posted at

対処法

第二引数のオプションにqualityscaleを設定する。

  • qualityは最高品質の1.0に設定
  • scaleは求める画質に応じた値を設定
const dataUrl = await domToPng(element, {
  quality: 1.0,
  scale: 2,
});
const link = document.createElement("a");
link.href = dataUrl;
link.download = filename;
link.click();

確認していませんが、domToJpegとかでも同様だと思います。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?