Page 2 of 2
Re: Change color of images without changing the texture
Posted: 2016-04-19T07:12:47-07:00
by Son13
Hi Snibgo, fmw42:
Thanks for your inputs and overall patience. I should have done a better good job in detailing the problem.
The need is to change the two different images to RED - maintaining the same RED tone.
When command (convert SAMPLE#.png -colorspace gray -auto-level +level-colors red,white RESULT#.png) is used on two different images the resultant IMAGES (RESULT1 & RESULT2) have two different shades of RED. Can the color shade be same instead of golden/red?
SAMPLE1:
https://www.dropbox.com/s/0finrl3539i7zwd/2.png?dl=0
RESULT1:
https://www.dropbox.com/s/x1f1yg4b09flwsu/21.png?dl=0
in two different shades of red. I want to preserve the tone of RED.
SAMPLE2
https://www.dropbox.com/s/mzd66hscv4njg8d/3.png?dl=0
RESULT2
https://www.dropbox.com/s/s1coo9yzi86rb85/31.png?dl=0
Re: Change color of images without changing the texture
Posted: 2016-04-19T07:14:43-07:00
by Son13
11
Re: Change color of images without changing the texture
Posted: 2016-04-19T09:15:35-07:00
by fmw42
Son13 wrote:11
What does this mean?
Re: Change color of images without changing the texture
Posted: 2016-04-19T09:33:01-07:00
by fmw42
try -modulate and adjust the hue (and saturation and brightness) as desired
Code: Select all
convert 2.png -modulate 100,100,80 2_mod.png
NOTE: Proprietary mages have been deleted by request
Re: Change color of images without changing the texture
Posted: 2016-04-19T09:53:57-07:00
by snibgo
Some red wigs:
[Moderator note: wig pictures removed at OP's request.]
wig2_red:
wig3_red:
wig3_red2:
wig3_shade, used to create shading in wig3_red2:
The Windows BAT script that made them:
Code: Select all
%IM%convert ^
wig2.png ^
-colorspace HSL ^
-channel R -evaluate Set 0 ^
-channel G -evaluate Multiply 3 ^
+channel ^
-colorspace sRGB ^
wig2_red.png
%IM%convert ^
wig3.png ^
+level-colors red,white ^
wig3_red.png
%IM%convert ^
wig3.png ^
-colorspace Gray ^
-evaluate Pow 0.25 ^
wig3_shade.png
%IM%convert ^
wig3_red.png ^
( +clone -alpha extract +write mpr:ALPH +delete ) ^
-colorspace HSL ^
-separate ^
wig3_shade.png ^
-delete 2 ^
-combine ^
-set colorspace HSL -colorspace sRGB ^
mpr:ALPH ^
-alpha off ^
-compose CopyOpacity -composite ^
wig3_red2.png
%IM%convert wig2_red.png -background White -flatten -quality 40 wig2_red.jpg
%IM%convert wig3_red.png -background White -flatten -quality 40 wig3_red.jpg
%IM%convert wig3_shade.png -background White -flatten -quality 40 wig3_shade.jpg
%IM%convert wig3_red2.png -background White -flatten -quality 40 wig3_red2.jpg
I converted to low-quality JPEGs purely for web speed.
Re: Change color of images without changing the texture
Posted: 2016-04-19T10:33:03-07:00
by Son13
you guys are awesome.
Is there any way to automate this batch script.... based on the source image color? Since the source images can be a combination of any of these colors?
http://beckerlelumber.com/zar.htm
Re: Change color of images without changing the texture
Posted: 2016-04-19T10:43:34-07:00
by snibgo
What does the wood stain have to do with the wigs? Do you want the wigs to have the colour of the wood stain? If so, you can find the mean colour of the stain sample, and use that instead of "red".
Re: Change color of images without changing the texture
Posted: 2016-04-19T10:57:17-07:00
by Son13
[quote][/quote]
Re: Change color of images without changing the texture
Posted: 2016-04-19T12:00:39-07:00
by fmw42
What platform and version of IM are you using? Please always provide that, since syntax may differ as well as scripting.
I do not script for Window, only Unix. So you may need help from one of the Windows users. But I would get the average hue of your original wig, then compute how much to shift the hue to get to red or whatever color you want from your color chart.
Re: Change color of images without changing the texture
Posted: 2016-04-19T12:06:16-07:00
by Son13
6.9.3.
Re: Change color of images without changing the texture
Posted: 2016-04-19T12:07:05-07:00
by fmw42
What platform?
Re: Change color of images without changing the texture
Posted: 2016-04-19T12:09:32-07:00
by fmw42
fmw42 wrote:I would get the average hue of your original wig, then compute how much to shift the hue to get to red or whatever color you want from your color chart.
You will likely have to adjust the brightness and contrast and saturation as well, since you won't get a light colored wig from a dark one.