Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
You want a transformation with two lines. "+level" or "-level" gives a transformation with only one line. We can do the second line with "-compose Lighten". Windows script:
If on Linux,Mac, see my script, plm, (piece-wise linear mapping) at the link below. The following will do what you want. Thought the values will be scaled to fit the range 0 to 100 for the graph and the listed breakpoints. However, the -s 255,255 allows values to be input in 8-bit range.
However two operations like this will add on extra set of 'rounding' errors.
The level with a compose lighten is another way to do it, as Fred gain in at previous topic.
Or perhaps we can add some type of -evaluate method? (clamp, and burn?)
I did think initially that maybe threshold-black would do the task, but that just pushes the values to 0 and not to the threshold level given.
It can be done with +level to adjust the Y intercept of the straight line appropriately, followed by -black-threshold, followed by -fill ... +opaque black to raise the black area to the desired level.
fmw42 wrote:It can be done with +level to adjust the Y intercept of the straight line appropriately, followed by -black-threshold, followed by -fill ... +opaque black to raise the black area to the desired level.
That will fail for images with color! but if it is grayscale, no problem.
fmw42 wrote:It can be done with +level to adjust the Y intercept of the straight line appropriately, followed by -black-threshold, followed by -fill ... +opaque black to raise the black area to the desired level.
That will fail for images with color! but if it is grayscale, no problem.
Why?
You can use it with a gradient LUT and then apply with -clut if that makes a difference?
Thank you very much.
I chose this method - "-level 20% +level 20%".
I don't know why, but here "http://www.imagemagick.org/Usage/color_mods/#level_plus" this command "convert test.png +level 20% -level 20% test_level_undo.png" just switch output point back to 0%. So, for real he do 20%,20%.