First, I'm not sure if a 'mask' is the correct operation. Here's what I'm trying to do.
+ I have 2 images. Image1 is color, Image2 is greyscale.
+ The greyscale image has pixel values from 0-255
Using the x,y pixel value of greyscale Image2, I want to darken (or lighten) the same x,y pixel value of color Image1.
Any help would be greatly appreciated!
Masking 2 images
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Masking 2 images
Please, always provide your IM version and platform when asking questions, since syntax may differ.
Also provide your exact command line and your images, if possible.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at viewtopic.php?f=1&t=9620
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
For novices, see
viewtopic.php?f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli
Perhaps what you want is (assuming IM 6)
If on IM 7, use magick rather than convert
See https://imagemagick.org/Usage/compose/#hardlight
Also provide your exact command line and your images, if possible.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at viewtopic.php?f=1&t=9620
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
For novices, see
viewtopic.php?f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli
Perhaps what you want is (assuming IM 6)
Code: Select all
convert image1 image2 -compose hardlight -composite resultimage
See https://imagemagick.org/Usage/compose/#hardlight
Re: Masking 2 images
Thanks for the quick response! I'll give that a try.
I'm using convert 6.7.8-9 Q16 on linux.
I'm using convert 6.7.8-9 Q16 on linux.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Masking 2 images
You may need to increase he contrast in image2. One way is -auto-level. Another is -level or -sigmoidal-contrast or -brightness-contrast.