[magick-users] Advanced 'Unsharp Mask' technique
Claus Cyrny
claus.cyrny at web.de
Sun Sep 16 09:36:01 PDT 2007
Hi all,
here's the first draft of a shell script I wrote, which is supposed
to be an advanced 'Unsharp Mask' technique (thanks to Anthony
for his suggestions).
The only problem is that the script, as it is now, results in error
messages right at the beginning ('No command convert' or to
the effect). This is most likely a syntax error on my part.
What this script is supposed to do, is:
1. Convert an RGB image into 'HSL'.
2. Copy the 'L' Channel into a mask.
3. Apply an edge detection to it.
4. Apply a Gaussian Blur to it .
5. Make a selection out of the mask (don't know
if this is necessary in IM; I would proceed like this
in a bitmap editor).
6. Select all the channels ('H','S', and 'L', and apply
the final 'Unsharp Mask' filter to them.
7. Convert the image back to RGB.
My script:
--- begin ---
#!/bin/sh
PATH=/home/ccyrny/Grafik/scripts; export PATH
convert $1 -colorspace HSL -channel R -separate $tmp0
convert $1 -colorspace HSL -channel R -separate $tmp1
convert $1 -colorspace HSL -channel R -separate $tmp2
convert -mask $tmp2
convert $tmp2 -edge 2.5
convert $tmp2 -unsharp 2.0
convert $tmp0 - colorspace $colormodel $tmp0 -compose CopyRed -composite \
$tmp1p -compose CopyGreen -composite \
$tmp2p -compose CopyGreen -composite \
-colorspace RGB $1.tiff
convert +mask
--- end ---
Can anyone see what mistakes I made here?
TIA,
Claus
P.S.: After taking a look at the script again, I see that
at least the two steps right after 'convert -mask $tmp2'
are not correct, because I don't want to work with the
'L' channel ($tmp2) as it is, but with the mask I (hopefully)
created out of $tmp2.
Fred: This is the script you wanted to know about!
--
Home Page - http://home.arcor.de/ccyrny/ [in English]
graf-o-matic 2.0 - http://grafomatic01.twoday.net/ [in German]
********** Powered by Ubuntu Linux - http://www.ubuntu.com/ ***********
More information about the Magick-users
mailing list