Layered Enhancing in convert command

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?".
Post Reply
SpyCam
Posts: 2
Joined: 2012-08-01T06:13:26-07:00
Authentication code: 15

Layered Enhancing in convert command

Post by SpyCam »

Hello.
I'm using some php software on a site, which only allows me enter Imagemagick commands that are used together with convert.

So if all convert line for cropping thumbnails would look like (example 1):

Code: Select all

convert -thumbnail 250x250 -enhance -filter Blackman -modulate 105,102,100 -sharpen 1x1 -quality 90 -strip
What I am allowed to enter into the IM commands field is (example 2):

Code: Select all

 -enhance -filter Blackman -modulate 105,102,100 -sharpen 1x1 -quality 90 -strip
It is not enough of one -enhance command to use, but two of them is too much.

Is it possible for me with my limitations to use layers to add one layer with 50% enhance on top? If yes, could you please help me with the command line that could be used inside of my example 2 line?

Thanks a lot.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Layered Enhancing in convert command

Post by fmw42 »

convert -thumbnail 250x250 -enhance -filter Blackman -modulate 105,102,100 -sharpen 1x1 -quality 90 -strip
Your code syntax is probably not correct for IM 6. The filter should be specified before -thumbnail

It should probably be

convert inputimage -filter Blackman -thumbnail 250x250 -enhance -modulate 105,102,100 -sharpen 1x1 -quality 90 -strip resultimage

Where exactly do you want to use a second enhance? Do you want to mix the results above with a second result above?

convert \( inputimage -filter Blackman -thumbnail 250x250 -enhance -modulate 105,102,100 -sharpen 1x1 -quality 90 -strip \) \( +clone -evaluate multiply 0.5 \) -compose plus -composite result

This will create the first thumbnail with -enhance, then add 50% of the same back to the first one.

see
http://www.imagemagick.org/Usage/compose/
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/basics/#seq_combine

If this is not what you want, please clarify further.
SpyCam
Posts: 2
Joined: 2012-08-01T06:13:26-07:00
Authentication code: 15

Re: Layered Enhancing in convert command

Post by SpyCam »

It should probably be
convert inputimage -filter Blackman -thumbnail 250x250 -enhance -modulate 105,102,100 -sharpen 1x1 -quality 90 -strip resultimage
Dear Fred,
in the input field, i have a way to add just the following in bold black:

convert inputimage -thumbnail 250x250 -filter Blackman -enhance -modulate 105,102,100 -sharpen 1x1 -quality 90 -strip resultimage

The things that go before and after it are hardcoded into software on a server.

Now, when you see my limitation, would it be correct, based on your suggestion, to use something like this?:
(-filter Blackman -enhance -modulate 105,102,100 \) \( +clone -evaluate multiply 0.5 \) -compose plus -sharpen 1x1 -quality 90 -strip -composite

I cannot use convert inputimage -thumbnail 250x250 and resultimage in the input field

Also, since I was trying to play with your denoise IM script, but couldn't... Is it possible to use it in my command line with the limitations I have? If yes, how? Can you post a couple examples please?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Layered Enhancing in convert command

Post by fmw42 »

convert inputimage -thumbnail 250x250 -filter Blackman -enhance -modulate 105,102,100 -sharpen 1x1 -quality 90 -strip resultimage
Sorry, but you may get into trouble if you do not put -filter Blackman before -thumbnail.

I am not sure what you want to duplicate or blend. If it is just the enhance, then try this for 50% more enhancement

convert inputimage -filter Blackman -thumbnail 250x250 -enhance \
\( +clone -evaluate multiply 0.5 \) -compose plus -composite \
-modulate 105,102,100 -sharpen 1x1 -quality 90 -strip resultimage

Unfortunately, you cannot mix bash shell scripts into the middle of a convert command very easily. You would have to write to miff: from part of your convert command, then pipe that result to standard in for my script writing to miff: again as output, then pipe that to another convert command using standard in to finish the processing. Thus convert input ... miff:- | script ... - miff:- | convert - .... output. And I am not even sure that will work.
Post Reply