How to set Gradient Map (effect) on photo/image ?
Here what i need
Original:
Gradient map (Photoshop):
Thanks.
Howto set gradient map on image/photo
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Howto set gradient map on image/photo
Convert image to grayscale. Then create a gradient as shown in viewtopic.php?f=1&t=13147 and apply the gradient using -clut.
convert image.jpg -colorspace gray grayimage.jpg
convert \( -size 1x1 xc:navy xc:yellow xc:navy +append \) \
-filter cubic -resize 256x1! -scale 256x20! gradient_lut.png
specify the colors that make your gradient look the way you want. see http://imagemagick.org/script/color.php
convert grayimage.jpg gradient_lut.png -clut coloredimage.jpg
convert image.jpg -colorspace gray grayimage.jpg
convert \( -size 1x1 xc:navy xc:yellow xc:navy +append \) \
-filter cubic -resize 256x1! -scale 256x20! gradient_lut.png
specify the colors that make your gradient look the way you want. see http://imagemagick.org/script/color.php
convert grayimage.jpg gradient_lut.png -clut coloredimage.jpg
Re: Howto set gradient map on image/photo
Big thanks !!! works perfectly !
One more question:
How to use rgb(255, 0, 0) instead of defined words: navy yellow navy ?
In this command
convert \( -size 1x1 xc:navy xc:yellow xc:navy +append \) \
-filter cubic -resize 256x1! -scale 256x20! gradient_lut.png
One more question:
How to use rgb(255, 0, 0) instead of defined words: navy yellow navy ?
In this command
convert \( -size 1x1 xc:navy xc:yellow xc:navy +append \) \
-filter cubic -resize 256x1! -scale 256x20! gradient_lut.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Howto set gradient map on image/photo
replacewaza123 wrote:Big thanks !!! works perfectly !
One more question:
How to use rgb(255, 0, 0) instead of defined words: navy yellow navy ?
In this command
convert \( -size 1x1 xc:navy xc:yellow xc:navy +append \) \
-filter cubic -resize 256x1! -scale 256x20! gradient_lut.png
xc:colorname
with
xc:"rgb(XX,YY,ZZ)"
for example for
xc:blue
you would have
xc:"rgb(0,0,255)"
you can also use hex color values
xc:"#0000ff"
see color definitions at http://imagemagick.org/script/color.php
Re: Howto set gradient map on image/photo
Again Thanks !
And maybe one more question:
i know that the first pixel of image x:1 y:1 is background white
Orig:
Step 1
Is there a way to replace white background of image with transperent background ?
Step 2
I do gradient
Step 3
Replace transperent with black background
And maybe one more question:
i know that the first pixel of image x:1 y:1 is background white
Orig:
Step 1
Is there a way to replace white background of image with transperent background ?
Step 2
I do gradient
Step 3
Replace transperent with black background
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Howto set gradient map on image/photo
waza123 wrote:Again Thanks !
And maybe one more question:
i know that the first pixel of image x:1 y:1 is background white
Orig:
Step 1
Is there a way to replace white background of image with transperent background ?
Step 2
I do gradient
Step 3
Replace transperent with black background
Actually the first pixel is 0,0 in IM.
convert image -transparent white transparentimage.gif (or.png)
do your gradient operation (but not sure how the formerly white area may get changed anyway)
convert gradientimagewithtrasparent -alpha on -channel rgba -fill black -opaque none blackbackgroundimage
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Howto set gradient map on image/photo
I have created a new script, tricolorize, to achieve the original colorization effect.
See http://www.fmwconcepts.com/imagemagick/index.html
See http://www.fmwconcepts.com/imagemagick/index.html
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Howto set gradient map on image/photo
I just recently fixed a bug in the -clut operator that prevented you re-coloring grayscale images using a gradient containing transparent and semi-transparent colors. To use this with -clut you needed to turn of the matte/alpha channel of the gray-scale image (so there was not alpha values for -clut to use, so it resorts to using the grayscale component) and set -channel RGBA.
See IM Examples, CLUT, recoloring with transparency
http://www.imagemagick.org/Usage/color/#clut_rgba
This bug fix is in the latest point release v6.4.9-8
See IM Examples, CLUT, recoloring with transparency
http://www.imagemagick.org/Usage/color/#clut_rgba
This bug fix is in the latest point release v6.4.9-8
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/