for example with range of 127 to 255
like this
I get this image in this link
https://docs.gimp.org/2.6/en/gimp-tool-threshold.html
Please help me
its possible apply threeshold with range in imagemagick(solved) ?
its possible apply threeshold with range in imagemagick(solved) ?
Last edited by diegomage on 2017-10-31T11:00:25-07:00, edited 1 time in total.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: its possible apply threeshold with range in imagemagick ?
255 looks like the maximum value.
Tell us what you want to happen inside the range, and outside the range.
Tell us what you want to happen inside the range, and outside the range.
snibgo's IM pages: im.snibgo.com
Re: its possible apply threeshold with range in imagemagick ?
I see this in imagemagick
-sepia-tone percent-threshold
simulate a sepia-toned photo.
Specify threshold as the percent threshold of the intensity (0 - 99.9%).
This option applies a special effect to the image, similar to the effect achieved in a photo darkroom by sepia toning. Threshold ranges from 0 to QuantumRange and is a measure of the extent of the sepia toning. A threshold of 80% is a good starting point for a reasonable tone.
-sepia-tone percent-threshold
simulate a sepia-toned photo.
Specify threshold as the percent threshold of the intensity (0 - 99.9%).
This option applies a special effect to the image, similar to the effect achieved in a photo darkroom by sepia toning. Threshold ranges from 0 to QuantumRange and is a measure of the extent of the sepia toning. A threshold of 80% is a good starting point for a reasonable tone.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: its possible apply threeshold with range in imagemagick ?
If you just want sepia tone. Then see http://www.imagemagick.org/Usage/color_mods/#sepia-tone. If you want to threshold that, then add -threshold XX%. You decide what value 0 to 100 to use for XX.
If you want a range threshold, see my bash unix shell script, slice, at my link below.
Alternately, use a combination of black-threshold and white-threshold.
For example, thresholding between 25%-75%
It is also possible the do range threshold by specifying the mid value (say 50%) and the range on each side of the mid value (say 25%), which should be the same as the previous way.
If you want a range threshold, see my bash unix shell script, slice, at my link below.
Alternately, use a combination of black-threshold and white-threshold.
For example, thresholding between 25%-75%
Code: Select all
convert -size 256x256 gradient: -black-threshold 25% -white-threshold 75% -fill black -opaque white -fill white +opaque black result.png
Code: Select all
convert -size 256x256 gradient: -fuzz 25% -fill black +opaque "gray(50%)" -fill white +opaque black result2.png
Re: its possible apply threeshold with range in imagemagick ?
I solved with this code
[*]
[*]
Code: Select all
convert image.png -threshold 80% mmk
convert image.png -threshold 86% -negate mmk2
composite -compose Multiply mmk mmk2 mmk3
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: its possible apply threeshold with range in imagemagick ?
Yes, that is another good method. But you can do that in one command
Code: Select all
convert image.png -write mpr:img +delete \
\( mpr:img -threshold 80% \) \
\( mpr:img -threshold 86% -negate \) \
-compose multiply -composite result.png
Re: its possible apply threeshold with range in imagemagick(solved) ?
very thankyou fmw42