Coloration

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?".
Post Reply
myspacee
Posts: 153
Joined: 2007-06-14T02:09:35-07:00

Coloration

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Coloration

Post by snibgo »

It's difficult if you don't provide the original.
snibgo's IM pages: im.snibgo.com
myspacee
Posts: 153
Joined: 2007-06-14T02:09:35-07:00

Re: Coloration

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Coloration

Post 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.
snibgo's IM pages: im.snibgo.com
myspacee
Posts: 153
Joined: 2007-06-14T02:09:35-07:00

Re: Coloration

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Coloration

Post 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
myspacee
Posts: 153
Joined: 2007-06-14T02:09:35-07:00

Re: Coloration

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Coloration

Post 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?
myspacee
Posts: 153
Joined: 2007-06-14T02:09:35-07:00

Re: Coloration

Post 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 :?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Coloration

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply