Fred Weinhaus wrote: > I am still a bit unclear about what you are trying to do. I made a graphic to illustrate what I'm trying to accomplish:
http://home.arcor.de/ccyrny/downloads/schema.png > > It appears that you want to use a mask generated from a grayscale > image. If that is the case, then you want to threshold the grayscale > image to make it binary and then apply it to another image to select > parts of that other image. If that is the case, then you need to use > -threshold to make the grayscale image into binary form, then use > -compose multiply -composite to apply it to another image. > > You can also do the composite with a grayscale image if you want the > underlying image to be seen at different intensities. The grayscale > image then acts as a transparency mask. I looked into the docs, but I'm not sure if '-threshold' is the proper option. (?) Anthony replied to a past post as follows: | You can also do the modifications in one command, but joining these | operations together. I did this recently in the IM forums. | | Here is a copy of the final... modify just the 'L' channel | command... | It splits up the image, clones the 'L' image into a separate | parenthesis, then swaps your changes for the original and | recombines them back together again. | | convert $infile -colorspace HSL -channel RGB -separate +channel \ | \( +clone ...L CHANNEL MODIFICATIONS HERE.... \ | \) +swap +delete \ | \( -clone 0 -colorspace HSL \ | -clone 0 -compose CopyRed -composite \ | -clone 1 -compose CopyGreen -composite \ | -clone 2 -compose CopyBlue -composite \ | \) -delete 0-2 -colorspace RGB $outfile | | Unfortunately as you see above the IM -combine can NOT handle | combining non-RGB greyscale channel images. This is a known bug | that has been reported, but one not simple to fix, as IM needs | some way to determine what colorspace the greyscale channel images | need to produce. | | I shall add the above to the IM Examples section... | Combining non-RGB Channel Images | http://www.imagemagick.org/Usage/channels/#combine_other | | It should appear in a day or so. I will have to look both into the docs as well into my script to see what I'm doing wrong. (I have to admit that I'm still comparably new to shell scripts, although I basically know about programming.) Additionally, here's my script in its present state (most likely still buggy): --- script -- #!/bin/sh convert $infile -colorspace HSB -channel R -separate $tmp0 convert vertigo_0011.png -colorspace HSB -channel G -separate $tmp1 convert $infile -colorspace HSB -channel B -separate $tmp2 convert $infile -colorspace HSB -channel RGB -separate +channel \ \( +clone -edge 2.5 -gaussian-blur 2 \ \ $tmp2 -mask clone2 \ \ $tmp2 -unsharp 2 \ \ $tmp2 > clone \ \) +swap +delete \ \( -clone 0 -colorspace HSB \ -clone 0 -compose CopyRed -composite \ -clone 1 -compose CopyGreen -composite \ -clone 2 -compose CopyBlue -composite \ \) -delete 0-2 -colorspace RGB $outfile $outfile > result.png display result.png --- /script -- Claus -- Web design,graphics, photography: http://home.arcor.de/ccyrny/ (English|German) Articles: http://www.americanchronicle.com/articles/viewByAuthor.asp?authorID=2153 (English) Blog: http://grafomatic01.twoday.net/ (basically in German) MySpace: http://www.myspace.com/claus_01 (English) _______________________________________________ Magick-users mailing list [email protected] http://studio.imagemagick.org/mailman/listinfo/magick-users
