dsgsgs30201 2014-01-09 19:08
浏览 58
已采纳

服务器端的CSS亮度/对比度

Looking for answer for 2 weeks. I have a tool which allows to adjust images' contrast and brightness directly in the web browser and use CSS3 properties to show result. But I should also apply these modification to original JPG at the server-side and output it back to user.

How can I do it? I am using PHP+Imagemagick, but can not find a way to do this conversion. Please help me.

  • 写回答

3条回答 默认 最新

  • douzhi9939 2014-01-13 01:53
    关注

    I found a great function of ImageMagick which allows us to do anything with brightness and contrast. It is "-level".

    But it doesn't allow to apply CSS3 brightness and contrast values directly. Thus I made a great investigation and calculate special formula to transfer CSS brightness and contrast values to "black point" and "white point" parameters of "-level" option. Please check this page (sorry, russian language, but you can use google translate). Roll to the bottom of page if you don't want to read all these equations.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 wpf datagrid如何实现多层表头
  • ¥15 为啥画版图在Run DRC会出现Connect Error?可我Calibre的hostname和计算机的hostname已经设置成一样的了。
  • ¥20 网站后台使用极速模式非常的卡
  • ¥20 Keil uVision5创建project没反应
  • ¥15 mmseqs内存报错
  • ¥15 vika文档如何与obsidian同步
  • ¥15 华为手机相册里面的照片能够替换成自己想要的照片吗?
  • ¥15 陆空双模式无人机飞控设置
  • ¥15 sentaurus lithography
  • ¥15 关于#linux#的问题:子进程1等待子进程A、B退出后退出(语言-c语言)