Hi,
I am trying to change the gamma of each image channel from an initial image but what I get is a strange yellow image ..
Although if I split and save each individual image it works correctly ...
So if do something like this I get the correct colored final image:
convert -monitor image1.jpg -depth 32 -auto-level -set colorspace RGB ^
-channel R -separate -gamma 3 -blur 0x2 PNG:image1_red.png
convert -monitor image1 -depth 32 -auto-level -set colorspace RGB ^
-channel g -separate -gamma 0.9 PNG:image1_green.png
convert -monitor image1 -depth 32 -auto-level -set colorspace RGB ^
-channel b -separate -gamma 0.85 PNG:image1_blue.png
convert -monitor image1_red.png image1_green.png image1_blue.png -colorspace RGB -quality 98 -combine JPG:image1_final.jpg
----------------------------------------------------------------------------------------------------------------------------
But if I try this :
convert -monitor image1 -depth 32 -auto-level -set colorspace RGB
( -clone 0 -channel R -separate -gamma 3 -blur 0x2 )
( -clone 0 -channel G -separate -gamma 0.95 )
( -clone 0 -channel B -separate -gamma 0.85 )
-delete 0 -colorspace RGB -quality 98 -combine JPG:iamge1_finala.jpg
I only get a full yellow image ....
What am I doing wrong ?
I even tried swaping the channels but still same problem this time with a resulting black image...
any ideas ?
[Solved] Combine RGB images problem
-
- Posts: 88
- Joined: 2010-06-29T14:36:09-07:00
- Authentication code: 8675308
[Solved] Combine RGB images problem
Last edited by markmarques on 2011-08-10T02:12:18-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Combine RGB images problem
You need to escape the new line with ^ and add +channel or -channel rgb at the end of each paren or possible use -respect-parenthesis in your first line
try either:
convert -monitor image1 -depth 32 -auto-level -set colorspace RGB ^
( -clone 0 -channel R -separate -gamma 3 -blur 0x2 +channel ) ^
( -clone 0 -channel G -separate -gamma 0.95 +channel ) ^
( -clone 0 -channel B -separate -gamma 0.85 +channel ) ^
-delete 0 -colorspace RGB -quality 98 -combine JPG:iamge1_finala.jpg
or
convert -monitor image1 -depth 32 -auto-level -set colorspace RGB -respect-parenthesis ^
( -clone 0 -channel R -separate -gamma 3 -blur 0x2 ) ^
( -clone 0 -channel G -separate -gamma 0.95 ) ^
( -clone 0 -channel B -separate -gamma 0.85 ) ^
-delete 0 -colorspace RGB -quality 98 -combine JPG:iamge1_finala.jpg
try either:
convert -monitor image1 -depth 32 -auto-level -set colorspace RGB ^
( -clone 0 -channel R -separate -gamma 3 -blur 0x2 +channel ) ^
( -clone 0 -channel G -separate -gamma 0.95 +channel ) ^
( -clone 0 -channel B -separate -gamma 0.85 +channel ) ^
-delete 0 -colorspace RGB -quality 98 -combine JPG:iamge1_finala.jpg
or
convert -monitor image1 -depth 32 -auto-level -set colorspace RGB -respect-parenthesis ^
( -clone 0 -channel R -separate -gamma 3 -blur 0x2 ) ^
( -clone 0 -channel G -separate -gamma 0.95 ) ^
( -clone 0 -channel B -separate -gamma 0.85 ) ^
-delete 0 -colorspace RGB -quality 98 -combine JPG:iamge1_finala.jpg
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Combine RGB images problem
The -gamma operator allows you to specify a different gamma for each channel directly...
See IM Examples...
http://www.imagemagick.org/Usage/color_mods/#gamma
to blur just the red channel only add the line...
afetr the gamma operator line. -blur understands -channel setting.
Code: Select all
convert -monitor image1 -depth 32 -auto-level ^
-gamma 3,0.95,0.85 ^
-quality 98 JPG:iamge1_finala.jpg
http://www.imagemagick.org/Usage/color_mods/#gamma
to blur just the red channel only add the line...
Code: Select all
-channel R -blur 0x2 +channel ^
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
-
- Posts: 88
- Joined: 2010-06-29T14:36:09-07:00
- Authentication code: 8675308
Re: Combine RGB images problem
I have tried the -gamma option previously but I need to change and add more things in each of the channels ...
Although it worked flawlessly with the "-respect-parenthesis" option ...
But I would never figured it out alone...
Thanks for the fast answer ...
Although it worked flawlessly with the "-respect-parenthesis" option ...
But I would never figured it out alone...
Thanks for the fast answer ...