图像渲染,但使图像更像素化? [英] Image-Rendering, but making images MORE pixelated?

查看:148
本文介绍了图像渲染,但使图像更像素化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要向我网站的用户说明,当他们的图像被打印到画布上时,它会失去质量,因为它会变得更大。在这样做的方法是故意降低他们在屏幕上提供的图像的分辨率,并免费声明为什么会这样。

I need to illustrate to a user of my website that when their image is printed onto a canvas it will lose quality as it will become larger. On way to do this is to deliberately lower the resolution of the image they provide on screen, with a disclaimer as to why it will be like this.

我听说过图像渲染,但我所看到的所有例子都可以理解,在增加图像大小时,可以在浏览器中改进图像。无论如何要保持图像大小相同但分辨率更低?很乐意使用css,JavaScript和PHP。

I heard about image-rendering but all the example I saw, understandably, where about improving the image across browsers when increasing the images size. is there anyway to keep the image the same size but lower the resolution? Will happily use css, JavaScript and PHP.

推荐答案

你可以使用来自Cloudinary的图像转换API

这是一个以您希望的方式返回转换后图像的API。考虑到你不需要任何特殊的或高带宽,这可能适合你。

It's an API that's returning transformed images the way you want them. Considering you don't need anything special nor high bandwidth, this just might suit you.

以下是如何使用它:


  • 创建免费帐户

  • 上传图片

  • 访问您的图片像这样: http://res.cloudinary.com/demo/image/upload/e_pixelate:4/sample.jpg

  • demo 是您的存储桶,图像是图像资源的目录, e_pixelate: 4 是效果及其参数的名称,最后 sample.jpg 是图像的文件名。

  • Create a free account
  • Upload an image
  • Access your image like this: http://res.cloudinary.com/demo/image/upload/e_pixelate:4/sample.jpg
  • demo is your "bucket", imageis a directory of an image resource, e_pixelate:4 is the name of effect and its parameter and finally sample.jpg is a file name of an image.

这篇关于图像渲染,但使图像更像素化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆