使用JS进行图像颜色处理 [英] Image colour manipulation using JS

查看:542
本文介绍了使用JS进行图像颜色处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我想在网页上显示一个简单的图像,并允许观众选择并更改其中一种颜色在图像中使用,并立即

预览结果。我想保持图像处理远离

服务器,以便更快地进行颜色选择/预览过程,而且我还要

不要预先 - 生成所有可能的图像,因为可以选择的颜色太多




JS(或任何JS库)是否提供图像处理功能

我可以搜索&替换图像中的颜色或

图像的一部分?


谢谢,

Stan

Hi there,

I want to show a simple image on a web page, and allow the viewer to
select and change one of the colours used in the image, and immediately
preview the result. I''d like to keep the image processing away from the
server to make the colour selection/preview process quicker, and I also
don''t want to pre-generate all possible images as there are too many
colours that can be selected.

Does JS (or any JS libraries) provide image manipulation capabilities
where I can search & replace a colour in an image or a portion of the
image?

Thanks,
Stan

推荐答案

Pulzar写道:
我想在网页上显示一个简单的图像,...
< ;剪断> JS(或任何JS库)是否提供图像处理能力,我可以搜索和替换
图像或图像的一部分中的颜色?
I want to show a simple image on a web page, ... <snip> Does JS (or any JS libraries) provide image manipulation
capabilities where I can search & replace a colour in an
image or a portion of the image?




您将无法通过Internet在Web浏览器中执行此操作。< br $>

Richard。



You will not be able to do that in a web browser over the Internet.

Richard.





Pulzar写道:
JS(或任何JS库)是否提供图像处理功能
我可以搜索和替换图像中的颜色或图像的一部分?
Does JS (or any JS libraries) provide image manipulation capabilities
where I can search & replace a colour in an image or a portion of the
image?




有一个规范作为canvas元素及其两个的一部分

维图形上下文:

< http://whatwg.org/specs/web-apps/current-work/#pixel>

但它看起来对我来说好像他们的画布上没有Firefox 1.5和Opera 9

实现支持getImageData方法。

Safari也有画布支持但我现在无法测试它是否可以支持

getImageData。


-


Martin Honnen
http://JavaScript.FAQTs.com/


<来自
的Pulzar写道:

Pulzar wrote:
JS(或任何JS库)是否提供图像处理功能
我可以在哪里搜索&替换图像中的颜色或图像的一部分?
Does JS (or any JS libraries) provide image manipulation capabilities
where I can search & replace a colour in an image or a portion of the
image?




您可以将图像转换为svg文件,在

服务器端,然后操纵svg文件。


操作服务器上的图像应该是一个快速操作,因为

libgd很快。



You may be able to convert the image into an svg file, on the
server-side, then manipulate the svg file.

Manipulating the image on the server should be a quick operation, as
libgd is fast.


这篇关于使用JS进行图像颜色处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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