How to change contrast

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: How to change contrast

Post by VanGog »

So the syntax in Windows should be

Code: Select all

convert sourceimage (clone 0 -fuzz ...%% -fill white -opaque "color")^
        (clone 0 -fuzz ...%% -fill white -opaque "color") ^
        (clone 0 -fuzz ...%% -fill white -opaque "color") ^
        (clone 0 -fuzz ...%% -fill white -opaque "color") ^
        (clone 0 -fuzz ...%% -fill white -opaque "color") ^
        (clone 0 -fuzz ...%% -fill white -opaque "color") ^
        (clone 0 -fuzz ...%% -fill white -opaque "color") ^
        (clone 0 -fuzz ...%% -fill white -opaque "color") ^
        (clone 0 -fuzz ...%% -fill white -opaque "color") ^
        (clone 0 -fuzz ...%% -fill white -opaque "color") ^
        (clone 0 -fuzz ...%% -fill white -opaque "color") ^
        (clone 0 -fuzz ...%% -fill white -opaque "color") ^
        (clone 0 -fuzz ...%% -fill white -opaque "color") ^
       -flatten outputimage
Right?
Last edited by VanGog on 2012-05-30T00:11:43-07:00, edited 2 times in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to change contrast

Post by fmw42 »

VanGog wrote:So the syntax in Windows should be

Code: Select all

convert sourceimage (clone 0 -fuzz ...%% -fill white -opaque "color")*
        (clone 0 -fuzz ...%% -fill white -opaque "color")*
        (clone 0 -fuzz ...%% -fill white -opaque "color")*
        (clone 0 -fuzz ...%% -fill white -opaque "color")*
        (clone 0 -fuzz ...%% -fill white -opaque "color")*
        (clone 0 -fuzz ...%% -fill white -opaque "color")*
        (clone 0 -fuzz ...%% -fill white -opaque "color")*
        (clone 0 -fuzz ...%% -fill white -opaque "color")*
        (clone 0 -fuzz ...%% -fill white -opaque "color")*
        (clone 0 -fuzz ...%% -fill white -opaque "color")*
        (clone 0 -fuzz ...%% -fill white -opaque "color")*
        (clone 0 -fuzz ...%% -fill white -opaque "color")*
        (clone 0 -fuzz ...%% -fill white -opaque "color")*
       -flatten outputimage
Right?
No, not quite. Remove all the clones and parenthesis and the -flatten and use ^ not * for next line with a space before the ^. All the -fuzz .. -fill ... -opaques can be chained on the same image.
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: How to change contrast

Post by VanGog »

Sorry, I don't know how the asterisks got there. I have mistaken some key and then copied.

OK thanks. But the principle of layering is as I shown is it right?

I think I understand you now

Code: Select all

convert sourceimage -fuzz ...%% -fill white -opaque red ^
        -fuzz 4%% -fill white -opaque blue ^
        -fuzz 4%% -fill white -opaque green ^
        -fuzz 4%% -fill white -opaque cyan ^
        -fuzz 4%% -fill white -opaque magenta ^
        -fuzz 4%% -fill white -opaque yellow ^
        -fuzz 4%% -fill white -opaque "color" ^
        -fuzz 4%% -fill white -opaque "color" ^
        -fuzz 4%% -fill white -opaque "color" ^
        -fuzz 4%% -fill white -opaque "color" ^
        -fuzz 4%% -fill white -opaque "color" ^
        -fuzz 4%% -fill white -opaque "color" ^
        -fuzz 4%% -fill white -opaque "color" ^
outputimage
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to change contrast

Post by fmw42 »

If you are not changing the fuzz values for each color, then you can just set it once at the beginning and all the other -fill ... -opaque results will use the same fuzz value. Otherwise, it looks correct. Just put in actual color names, rgb(...) or hex values for the work "color"
VanGog
Posts: 308
Joined: 2012-02-05T02:46:58-07:00
Authentication code: 8675308

Re: How to change contrast

Post by VanGog »

I see this job will be yet a lot of work. I must get better quality images because I cannot exactly define borders of road in some areas. I use fuzz 1,2,3 or 4, rarely more. Many colors to define so the process will take long. Also I will need to generate more masks and perform subtract or addition operators between two masks. Because I need to define areas which are road only, and areas which are houses. There should be different edge type. Streets and roads need inward orientated edges, but houses need outward orientated edges + detection of underlaying color. Restated, the lights of road shines to the road but street light do not shine over the houses, nor over forests, water surfaces or fields.

In meantime, You can send me information about functions to add or subtract one mask to/from another
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How to change contrast

Post by fmw42 »

Post Reply