Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
if the original color is not gray ,can use this method to do:
(modulate convert ,why the result is not the same color?) viewtopic.php?f=1&t=19044
when the original color is gray ,the hsl (h=0,s=0,l=x) is not suitable for "hue/hue" compare ,then can not get the modulate hue or saturation.
Then how to do this covert?
blue gradient:
convert -size 100x100 gradient:"#0897ef-black" tmp2.png
gray to blue gradient:
convert tmp1.png -auto-level +level-colors "black,#0897ef" tmp1_2.png
tmp2.png and tmp1_2.png are the same
you have to stretch the gray gradient to full dynamic range before applying +level-colors with the proper color values.
note the order of the two colors in the gradient and in +level-colors are reversed.
to ensure the correct results you should specify both values. if you don't, then one will be assumed black and the other will be assumed white (at least in the gradient, if not both)
Sorry, you will have to show more steps and what functions in PS you are using. I only have an old PS CS and am not that familiar with it and perhaps it does not have the same functions you are using.
I do not reproduce your image. I am not sure what you are doing exactly with hue and saturation. Are you using HSL or HSB? So I cannot even reproduce it in Photoshop. I don't see a colorize option in my old PS.
Does this reproduce your PS result?
h=$((100*243/360))
s=66
echo "h=$h; s=$s"
convert -size 100x100 gradient:"#b3b3b3-#0897ef" -colorspace hsl \
-channel r -evaluate set $h% +channel -channel g -evaluate set $s% \
+channel -colorspace rgb tmp6.png
Last edited by fmw42 on 2011-07-09T23:18:54-07:00, edited 1 time in total.
1,i firstly ceate the #b3b3b3-#4d4d4d gradient in photoshop (ie:a.png)
2,then use Hue/Saturation tool to get some random color to get the colorize gradient (ie:b_gd.png)
3,the i pick the top color of the colorize gradient (ie:0897ef),and paste a square to get the pure color (ie:b.png)
my thinking is that if i had gray-scale img ,i want to colorize it base on a given color (ie :0897ef) ,the colored png is mainly close to my given color. no need very strick calculation,but seems trending to my given color.
it seems very hard to do this , sorry for my awkward request . if too wasting time ,pls ignore this topic.