convert white shade to red shade using recolor

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
sujan.dasmahapatra
Posts: 44
Joined: 2012-02-18T21:42:01-07:00
Authentication code: 8675308

convert white shade to red shade using recolor

Post by sujan.dasmahapatra »

how can i convert white shade into red shade using recolor. i am trying like this but it's not coming.

Code: Select all

convert shirt0.jpg  -recolor '1 0 0 0 0 0 1 1 1' shirtmod01.jpg
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert white shade to red shade using recolor

Post by anthony »

JUst turn off the green and blue channels!

Code: Select all

convert image.png -color-matrix '1,0,0  0,0,0  0,0,0' result.png
This has the same effect as using +level-colors ,red a straight linear white to red modification of RGB values.

however is this what you want? You may get a better result by doing the level on a grayscale image!

Code: Select all

convert image.png -type grayscale +level-colors ,red result.png
Or doing both operations together using some varient of...
convert image.png -color-matrix '.2 .5 .3 0,0,0 0,0,0' result.png
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply