简体   繁体   English

如何在不损失质量的情况下扩展图像?

[英]How to expand image without losing quality?

I have a png image, or in a blob. 我有一个png图像或斑点。 This image has a particular size, lets say 800px*600px when I resize it using some canvas methods like this one: Resize image, need a good library it losses quality. 该图像具有特定的大小,例如,当我使用像这样的一些画布方法调整其大小时,可以说800px * 600px: 调整图像大小,需要一个好的库,它会降低质量。

I want to resize my image to something like 4000px and not bluring the content. 我想将图像调整为4000像素左右,而不模糊内容。 Is there a way to do it? 有办法吗? Inside my image there is only text. 我的图片中只有文字。

I am using Angular CLI: 1.7.3 Node: 8.9.0 Angular: 4.4.6 Typescript: 2.3.4 我正在使用Angular CLI:1.7.3节点:8.9.0 Angular:4.4.6打字稿:2.3.4

What's probably happening is that there is some automatic aliasing being applied when you resize the canvas. 可能发生的情况是在调整画布大小时会应用一些自动别名。 Using this other question for reference , it seems that you might need to specify the interpolation mode to nearest-neighbor: 使用这个其他问题作为参考 ,似乎您可能需要将插值模式指定为最近邻:

canvas {
  image-rendering: optimizeSpeed;             // Older versions of FF
  image-rendering: -moz-crisp-edges;          // FF 6.0+
  image-rendering: -webkit-optimize-contrast; // Webkit (non standard naming)
  image-rendering: -o-crisp-edges;            // OS X & Windows Opera (12.02+)
  image-rendering: crisp-edges;               // Possible future browsers.
  -ms-interpolation-mode: nearest-neighbor;   // IE (non standard naming)
}

(code snippet fetched from referenced question) (从引用的问题中提取的代码段)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Uploadcare:如何防止图像质量下降? - Uploadcare: How to prevent losing image quality? 如何在不损失图像质量的情况下将Base64图像旋转90度? - How to rotate a Base64 image by 90 degree without losing image quality? 如何使用php或任何其他语言减小图像文件大小而又不损失质量或分辨率? - How to reduce Image file size without losing quality or resolution using php or any other language? HTML5 Canvas图像裁剪,调整大小和保存而不会降低质量 - HTML5 Canvas image crop, resize, and save without losing quality 无头浏览器在不损失质量的情况下获取图像的 data-URI - Headless browser get data-URI of an image without losing the quality 调整大小后丢失图像质量 - Losing image quality after resizing it 如何在不损失画质的情况下增大Patternizer模式 - How to make Patternizer pattern larger without losing quality 如何阻止背景图像在屏幕调整大小时失去质量/模糊 - How to stop background image from losing quality/ blurring on screen resize 在不降低质量的情况下缩小 Konvajs 阶段 - Scale down a Konvajs stage without losing quality 调整图像JavaScript / jQuery的大小而不会降低质量 - Resizing images JavaScript/jQuery without losing quality
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM