Page 9 of 9

Re: Sophisticated fuzz with HSL definition?

Posted: 2014-06-11T01:48:05-07:00
by VanGog
Thanks. Your code works. I learned something definitely. But the actions which I want to do are more complicated so I must begin from begin and change the way how I do it. I think I have thought how to do it best. But now I am having this problem:

Code: Select all

convert map.png -write mpr:input +delete ^
  ( -fuzz 8%% -fill black +opaque "#5189CF" ) ^
  ( -fuzz 8%% -fill black +opaque "#FFE57D" ) ^
  -evaluate-sequence add ^
    -blur 0x1.0 -threshold 4.5%% -fill red -opaque white highway_result_extra_add.png
Error: missing image filename highway_result_extra_add.png

I have feeling like doing the same mistakes still around, but we have a proverb in my language saying "repetition is mother of wisdom".

Re: Sophisticated fuzz with HSL definition?

Posted: 2014-06-11T01:56:29-07:00
by snibgo
Each fuzz has no input.

Re: Sophisticated fuzz with HSL definition?

Posted: 2014-06-11T09:20:54-07:00
by fmw42
As snibgo said, you need your mpr image created in the first line as input to each parenthesis. Any parenthesis processing needs an image or a clone or an mpr image. That is why it is called processing on the side. It is like its own convert command and has to have an image on which to work.

convert map.png -write mpr:input +delete ^
( mpr:input -fuzz 8%% -fill black +opaque "#5189CF" ) ^
( mpr:input -fuzz 8%% -fill black +opaque "#FFE57D" ) ^
-evaluate-sequence add ^
-blur 0x1.0 -threshold 4.5%% -fill red -opaque white highway_result_extra_add.png

Re: Sophisticated fuzz with HSL definition?

Posted: 2016-06-01T08:36:59-07:00
by VanGog
I am back to learn how to work with multiple layers. Just tried examples from page 8 and they do not work for me suddenly. I have saved the batch files when I did this years ago but they do not work. For me. The colors in -fill are correct as I checked it again.

Now this command:

Code: Select all

convert map.png -write mpr:input +delete ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#FFE168" ) ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#E5bC4C" ) ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#FFF1B3" ) ^
  -evaluate-sequence add -blur 0x1.6 -threshold 25%% -write t1.png ^
  -evaluate-sequence add -blur 0x2.4 -threshold 2.5%% -write t2.png
>convert map.png -write mpr:input +delete ( mpr:input -fuzz 2% -fill black +opaque "#FFE168" ) ( mpr:input -fuzz 2% -fill black +opaque "#E5bC4C" ) ( mpr:input -fuzz 2% -fill black +opaque "#FFF1B3" ) -evaluate-sequence add -blur 0x1.6 -threshold 25% -write t1.png -evaluate-sequence add -blur 0x2.4 -threshold
2.5% -write t2.png
convert.exe: option requires an argument `-write' @ error/convert.c/ConvertImage
Command/2996.

>pause

This command is original from batch file which should work but it generated empty (black) images

Code: Select all

convert map.png -write mpr:input +delete ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#FFE168" ) ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#E5bC4C" ) ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#FFF1B3" ) ^
  -evaluate-sequence add -blur 0x1.6 -threshold 25%% -write highway_result_basic_1.png ^
  -delete 0-3 ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#FFE168" ) ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#E5bC4C" ) ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#FFF1B3" ) ^
  -evaluate-sequence add -blur 0x2.4 -threshold 2.5%% highway_result_basic_2.png
IM ver. 6.7.5-1 Q8

When no-one of these commands works then I tried this:

Code: Select all

convert -size 64x64 canvas:black +write mpr:input ^
  ( mpr:input -size 64x64 xc: -draw "circle 22,32 5,32" ) ^
  ( mpr:input -size 64x64 xc: -draw "circle 41,32 58,32" ) ^
  -evaluate-sequence add -write t.png
and it also says error I must use -write option

Edit on the other hand if I change -evaluate-sequence add for
-compose lighten
it works and creates images like highway_result_basic_1-0.png highway_result_basic_1-1.png highway_result_basic_1-2.png
however I wanted one image where the three masks are joined to one so I used -evaluate-sequence add ... I also thought is should I try -clone 0-2 and then the sequence, but fails coz -evaluate-sequence wants -write argument.

Re: Sophisticated fuzz with HSL definition?

Posted: 2016-06-01T10:17:32-07:00
by fmw42
Once you do -evaluate-sequence once, you no longer have the previous images. So you need to clone them to use in new paren operations for each evaluate-sequence. The null: is needed to remove temporary images from the command line.

Code: Select all

convert map.png -write mpr:input +delete ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#FFE168" ) ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#E5bC4C" ) ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#FFF1B3" ) ^
  ( -clone 0-2 -evaluate-sequence add -blur 0x1.6 -threshold 25%% -write t1.png +delete ) ^
  -evaluate-sequence add -blur 0x2.4 -threshold 2.5%% t2.png
or

Code: Select all

convert map.png -write mpr:input +delete ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#FFE168" ) ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#E5bC4C" ) ^
  ( mpr:input -fuzz 2%% -fill black +opaque "#FFF1B3" ) ^
  ( -clone 0-2 -evaluate-sequence add -blur 0x1.6 -threshold 25%% -write t1.png +delete ) ^
  ( -clone 0-2 -evaluate-sequence add -blur 0x2.4 -threshold 2.5%% -write t2.png ) ^
  null:

Re: Sophisticated fuzz with HSL definition?

Posted: 2016-06-01T10:34:14-07:00
by fmw42
Note: The above has been edited to correct a mistake.

Re: Sophisticated fuzz with HSL definition?

Posted: 2016-06-02T01:40:41-07:00
by VanGog
Once you do -evaluate-sequence once, you no longer have the previous images.
That is important information.
Could someone add this to the description?
http://www.imagemagick.org/script/comma ... e-sequence

Re: Sophisticated fuzz with HSL definition?

Posted: 2016-06-02T02:29:10-07:00
by snibgo
This is the way that all image-processing operations work. They replace the input image(s).

Some operations (such as "-blur") replace each input with a new output. Some operations (such a "-evaluate-sequence" and "-layers merge") replace all of the inputs with a single output. If you want to do an operation while keeping the input, use "clone".

Re: Sophisticated fuzz with HSL definition?

Posted: 2016-06-02T08:47:07-07:00
by VanGog
Ok, this is why I was confused because I expected IM layers works similarly like Photoshop, where all layers stay in memory and do not merge them-self or remove them-self until user does it.