久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

想像|漸變圖

imagick | Gradient map(想像|漸變圖)
本文介紹了想像|漸變圖的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我正在嘗試使用 imagick 在圖像上獲得這種效果.在 photoshop 中它被稱為漸變圖,但我在 imagick 中找不到與此類似的任何東西.

我想我需要先把它變成黑白的,但我不知道這樣做之后如何添加顏色.

希望能幫到你!謝謝

--- ---

  • 我使用的是 Imagick,而不是 imagemagick.
  • 請注意,圖像中有兩種顏色,而不僅僅是著色.深藍色為深藍色,淺綠色/淺綠色為淺綠色.

解決方案

PHP Imagick Version

現在我已經了解了你的需求,我已經做了一個 Imagick PHP 版本:

modulateImage(100,0,100);//制作雙色調 CLUT$clut = new Imagick();$clut->newPseudoImage(255,1,"gradient:darkblue-aqua");//對圖像應用雙色調 CLUT$image->clutImage($clut);//輸出結果$image->writeImage('result.jpg');?>

更新答案

哦,我認為您想要的是 雙色調" 而不是 色調".基本上,您需要將圖像去飽和度為單色,制作雙色調 CLUT(顏色查找表)并應用它.

以下是制作 CLUT 的方法:

convert -size 1x256!漸變:海軍橙色雙色調clut.png

這顯然會讓你的深色調和高光變成橙色,但你可以隨意使用這些顏色.您還可以根據需要使用以下語法指定任何 RGB(或 HSL)陰影:

convert -size 1x256!漸變:rgb(255,255,0)-rgb(23,45,100)"...

以下是如何將圖像去飽和為灰色,然后應用 CLUT:

convert Landscape.jpg -modulate 100,0 -尺寸 256x1!漸變:海軍橙色-clut result.jpg

-modulate 需要 3 個參數 - 色調、飽和度和亮度.通過指定 100,0,我將色相保留為 100%,并將飽和度降低到零并保持亮度不變.

順便說一下,如果你想要一個 tritone" 有 3 種顏色,一種用于陰影,一種用于中間調,一種用于高光,你可以這樣制作:

convert -size 1x1!xc:yellow xc:magenta xc:cyan +append -resize 256x1!-scale x20 clut.png

這給了這個:

您還可以在 CLUT 中移動交叉點,使用對比度拉伸或通過相同顏色填充更大比例的 CLUT.在這里,我通過有 2 個黃色塊使陰影顏色 更長".

convert -size 1x1!xc:yellow xc:yellow xc:magenta xc:cyan +append -resize 256x1!clut.png

這給更長"陰影:

顯然你也可以制作四音(quad-tone).

原答案

實現效果的方法有很多種.所以,從這張圖片開始:

您可以像這樣使用 tint,它對應于 PHP 中的 tintImage(),描述

或者您可以克隆初始圖像并用您的色調填充克隆,然后將其合成到圖像的頂部.您將在 PHP 中使用 colorizeImage(),在

I'm trying to get this effect on images using imagick. In photoshop it's called a gradient-map, but I can't find anything similar to this in imagick.

I think I need to make it black-and-white first, but I don't get how to add the colors after doing so.

Hope you can help! Thanks

--- EDIT: ---

  • I'm using Imagick, not imagemagick.
  • Notice there are two colors in the image, it's not just colorized. Dark blue for the darker colors, and light green/aqua for the lighter ones.

解決方案

PHP Imagick Version

Now I have understood your needs, I have done an Imagick PHP version:

<?php
   // Load input image
   $image = new Imagick('landscape.jpg');

   // Desaturate image
   $image->modulateImage(100,0,100);

   // Make duotone CLUT
   $clut = new Imagick();
   $clut->newPseudoImage(255,1,"gradient:darkblue-aqua");

   // Apply duotone CLUT to image
   $image->clutImage($clut);

   // Output result
   $image->writeImage('result.jpg');
?>

Updated Answer

Oh, I think you want a "duotone" rather than a "tint". Basically, you need to desaturate your image to mono, make a duotone CLUT (Colour Lookup Table) and apply that.

Here is how to make a CLUT:

convert -size 1x256! gradient:navy-orange duotone-clut.png

This one will obviously make your dark tones navy and your highlights orange, but you can play around with the colours as you wish. You can also specify any shades of RGB (or HSL) as you wish with syntax like:

convert -size 1x256! gradient:"rgb(255,255,0)-rgb(23,45,100)" ...

Here is how to desaturate your image to grey and then apply the CLUT:

convert landscape.jpg -modulate 100,0 
  -size 256x1! gradient:navy-orange -clut result.jpg

The -modulate takes 3 parameters - Hue, Saturation and Lightness. By specifying 100,0 I have left the Hue at 100% of whatever it was and reduced the Saturation to zero and left the Lightness unchanged.

By the way, if you want a "tritone" with a 3 colours, one for shadow, one for midtones and one for highlights, you can make one like this:

convert -size 1x1! xc:yellow xc:magenta xc:cyan +append -resize 256x1! -scale x20 clut.png

Which gives this:

You can also move the crossover points around in the CLUT, either using a contrast-stretch or by having a bigger proportion of your CLUT populated by the same colours. Here I make the shadow colour "longer" by having 2 yellow blocks.

convert -size 1x1! xc:yellow xc:yellow xc:magenta xc:cyan +append -resize 256x1!  clut.png

That gives "longer" shadows:

Obviously you can make a quadtone (quad-tone) too.

Original Answer

There are a number of ways of achieving the effect. So, starting with this image:

You could use tint like this, which corresponds to tintImage() in PHP, described here:

convert landscape.jpg -colorspace gray -fill "rgb(10,100,130)" -tint 100 result.png

Or you could clone your initial image and fill the clone with your tint colour and then composite that over the top of your image. You would use colorizeImage() in PHP, described here:

convert landscape.jpg -colorspace gray                  
   ( +clone -fill "rgb(10,100,130)" -colorize 100% )  
   -compose overlay -composite result.png

這篇關于想像|漸變圖的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Add programmatically a downloadable file to Woocommerce products(以編程方式將可下載文件添加到 Woocommerce 產品)
Get today#39;s total orders count for each product in Woocommerce(獲取今天 Woocommerce 中每種產品的總訂單數)
Add Custom registration fields in WooCommerce and phone field validation issue(在 WooCommerce 和電話字段驗證問題中添加自定義注冊字段)
Add a select field that will change price in Woocommerce simple products(在 Woocommerce 簡單產品中添加一個將更改價格的選擇字段)
Add custom columns to admin products list in WooCommerce 3(在 WooCommerce 3 中將自定義列添加到管理產品列表)
Customizing checkout quot;Place Orderquot; button output html(自定義結帳“下訂單按鈕輸出html)
主站蜘蛛池模板: 国产一区二区三区网站 | 成av在线 | 国产日韩精品一区 | 国产一区二区影院 | 拍戏被cao翻了h承欢 | 欧美一区二区三区在线视频 | 福利视频一区 | 亚洲精品成人 | 国产精品久久视频 | 在线国产一区 | av在线免费网站 | 在线看国产 | 亚洲精品高清视频在线观看 | 国产精品777一区二区 | 久久免费观看视频 | 毛片视频免费观看 | 国产精品99久久久久久久久久久久 | 国产成人久久av免费高清密臂 | 国产91亚洲精品 | 天天操妹子 | 国产免费一区二区三区 | 在线视频亚洲 | 成人在线免费看 | 国产网站在线免费观看 | 日韩中文字幕在线视频观看 | 高清18麻豆 | 日韩一区二区在线免费观看 | 国产极品车模吞精高潮呻吟 | 日本一区二区三区精品视频 | 国产日韩一区二区 | 羞羞视频在线观看 | 黄色网页在线 | 在线国产精品一区 | 亚洲一区二区久久 | 亚洲劲爆av| 91免费小视频 | 欧美a区| 日韩精品在线一区 | 色综网| 久久久久成人精品 | 成av在线 |