possible (documentation) error in -level IM 6.4.1-7

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible (documentation) error in -level IM 6.4.1-7

Post by fmw42 »

According to the documentation for -level

"if the white point is omitted it is set to QuantumRange-black_point"

This (terminology) is confusing at the least!

So some tests:

convert rose: -level 0,100% tmp.png (output same as input as expected)

convert rose: -level 0,0% tmp.png (output pure white as expected)

convert rose: -level 0% tmp.png (leave off the white point value)

In this last case the output is the same as the input. However, I interpret the documentation regarding the white point set to QuantumRange-black_point to mean 0% and thus -level 0% would be the same as -level 0,0% and produce a white image as in the second case, but it produces an unchanged image as if the white point were set to QuantumRange-white_point, which I interpret to mean 100%, i.e., the first example above.

Am I misinterpreting the meaning of QuantumRange-black_point in the documentation? If not, then perhaps the documentation should be changed to QuantumRange-white_point.


On the other hand, doing some other experiments:

convert rose: -level 50% tmp.png
convert rose: -level 50,100% tmp2.png
convert rose: -level 50,50% tmp3.png

In this case, tmp.png and tmp3.png are the same and therefore the missing white-point value is not QuantumRange-black_point or QuantumRange-white_point. It is simply the same as the first value.

Thus, these two tests do not seem consistent with regard to what value is used for a missing white point value.

One more test:

convert rose: -level 100% tmp.png
convert rose: -level 100,0% tmp2.png
convert rose: -level 100,100% tmp3.png

In this case, tmp.png and tmp2.png are identical.

Thus from all these tests, it would appear that the missing white point is the complement of the black point. blackpoint= 0% => white point=100%; blackpoint= 50% => white point=50%; blackpoint= 100% => white point=0%;

OK. Then that explains what you mean by QuantumRange-black_point. I mistook the hyphen as a hyphen and not a minus sign. But I think it would be better expressed differently, such as QuantumRange minus the black point value, or QuantumRange - black point, or the complement of the black point value.

Is this what the documentation really means?

Thanks. Sorry for the real-time testing and long message

Fred

P.S. I will try to make the edits for this (if this is OK with you) as it will be a good test for me to see if I can help in the documentation.
Post Reply