Page 1 of 1

Coloration

Posted: 2014-07-09T07:46:38-07:00
by myspacee
Hello,
see in jqmagick two effect can't replicate

Blue coloration
Image
Vintage Heritage
Image

anyone can post syntax fore these effect ?

thank you,
m.

Re: Coloration

Posted: 2014-07-09T08:20:50-07:00
by snibgo
It's difficult if you don't provide the original.

Re: Coloration

Posted: 2014-07-09T08:27:40-07:00
by myspacee
I think that all images can be 'converted'.
Reading about coloration here : http://www.fmwconcepts.com/imagemagick/ ... /index.php
but can't use this script i'm on Windows machine.

Is there differencies from an image to another to apply these effects ?

m.

Re: Coloration

Posted: 2014-07-09T08:38:04-07:00
by snibgo
You can (I am told) run Fred's bash script on Windows if you install Cygwin. Otherwise, you need to translate to one of Window's script languages.

Re: Coloration

Posted: 2014-07-09T13:44:53-07:00
by myspacee
Try to read fmw script but it's out of range for me.

I think to blue coloration as sort of 'sepia' effect, but now i know is not so simple.
Maybe boss let me install Cygwin on production server but i don't believe i can convince...

Any hope to have any help or hints for these effects?

Please?

Image

Re: Coloration

Posted: 2014-07-09T14:52:34-07:00
by fmw42
coloration is really very easy. just see the bottom of my example page. it shows the commands used. but to simplify even further just do the following: convert the image to grayscale, create a 1x1 black, somecolor, white appended 1D image and stretch it out to 256x1 as a clut, then apply the lut to the grayscale image. I used HSL colors, but you can use RGB if you want.

This is just another way to tint. You could just use -tint. It is like duocolor or really tricolor, since it has white and black in the lut. See http://www.imagemagick.org/Usage/color_mods/#tinting,

See
http://www.fmwconcepts.com/imagemagick/ ... hp#rainbow.

See also colors in HSL
http://www.imagemagick.org/script/color.php


Unix:

Code: Select all

convert image -colorspace gray \
\( -size 1x1 xc:black xc:"hsl(50%,50%,50%)" xc:white +append -filter cubic -resize 256x1! \) \
-clut result

Window (I think, though am not sure -- you may have to escape the exclamation as ^!):

Code: Select all

convert image -colorspace gray ^
( -size 1x1 xc:black xc:"hsl(50%%,50%%,50%%)" xc:white +append -filter cubic -resize "256x1!" ) ^
-clut result
Modify the hue and saturation values as desired. You can also change the grayscale image by modifying it with -sigmoidal-contrast (-brightness-contrast) or by using -grayscale xxx rather than -colorspace. Or by mixing channels using -color-matrix. See
http://www.imagemagick.org/Usage/color_mods/#clut
http://www.imagemagick.org/Usage/color_ ... lor-matrix

Re: Coloration

Posted: 2014-07-11T07:13:10-07:00
by myspacee
Thank you for reply and explanation,
find also this :

Code: Select all

convert image -set colorspace Gray -separate -average -contrast -set colorspace RGB -contrast -colorize 10,5,0 -contrast result
Can you explain differences?

thank you, for all,
m.

Re: Coloration

Posted: 2014-07-11T09:15:45-07:00
by fmw42
convert image -set colorspace Gray -separate -average -contrast -set colorspace RGB -contrast -colorize 10,5,0 -contrast result
This command makes no sense to me and does not add much color if anything at all and -colorize needs a fill color to work. Did you try it?

Re: Coloration

Posted: 2014-07-11T14:44:04-07:00
by myspacee
I change in

Code: Select all

convert image -set colorspace Gray -separate -average -contrast -set colorspace RGB -contrast -colorize 25,5,0 -contrast result
And obtain blue effect. I explain to myself with RGB % variation... I'm not so sure :?

Re: Coloration

Posted: 2014-07-11T14:59:45-07:00
by snibgo
See http://www.imagemagick.org/script/comma ... p#colorize

The default "-fill" is Black.

So you are colorizing with black, a different amount per channel. With 25,5,0 you are darkening red by most, and darkening green a little. Naturally, this makes the result bluer.