dsb238100 2015-06-02 02:13
浏览 37

PHP图像处理。 棕褐色,饱和,烤面包机过滤器与CSS完全相同

I need to create a script, which lets user to apply some instagram-like filters to their images. First it should done in browser. Easiest way to do it are of course css3 filters. Then image should be uploaded to server, and it must be saved with exactly same filters as seen in browser.

And now the problem begins. I can do some sepia, saturated ot toaster-like effects with Image Magick, or with Image GD libraries, but results will look different from images we see in browser. "Sepia" by Image Magick is not like "sepia" we see when using css "filter: sepia();". And even worse: user may decide for a filter combination (sepia, saturated, plus toaster, plus contrast, etc.). I have almost no idea how to recreate it.

Only solution I have now, is to do "in-browser" effects without css, on canvas element (so, I can easily use the same algorithms in browser and on server). But I find this ugly, I would like to stay with css3.

Is there anywhere a good description of css filters inner architecture?

  • 写回答

2条回答 默认 最新

  • doubi1624 2015-06-02 03:18
    关注

    I don't think CSS would be the best way to go about it. While you can make use of plugins like CamanJS (http://camanjs.com) which make use of HTML5 Canvas but provide a whole lot of functionality and options to make your own filters or use existing ones.

    However, if you still want to work with CSS. You can take a look at this CSS Filter Module Draft here which will explain exactly the inner architecture you're looking for. http://www.w3.org/TR/filter-effects/#sepiaEquivalent

    评论

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?