EP0187911: Thresholding technique for graphics images using histogram analysis (IBM (US)) http://swpat.ffii.org/patents/txt/ep/0187/911/ Claims: 1. Computation of 3 thresholds for a gray scale image for converting to 2-bit: * calculate histogram and median * determine real (occupied) start and end of the histogram * compute background color: black only, when it outweighs, else white * calculate edge color between foreground and background * specify the thresholds inside the foreground range 2. Calculation of mentioned real start and end (color) values in the histogram, summing up from start/end until (not further specified) "significant" amount and going back until a zero-value is found (or limit reached) 3. Thresholds inside foreground range, from edge to foreground-minimum, levels 1/8, 1/4, 1/2 4. Like 3., but with 3/16, 3/8, 3/4 5. Determination of the background color: When difference between median and real start value is smaller than half of the difference between the median and the real end value, take black, else white. i.e. white is standard, black only in extreme cases 6. Apparatus implementing 1. 7. Apparatus implementing 2. 8. Apparatus implementing 3. 9. Apparatus implementing 4. 10. Apparatus implementing 5. Violation programm, Python script (CAUTION: PLEASE DO NOT EXECUTE!): threshold.py (see attachment) My apologies for the size of the program, but there are some reasons: 1. The author concatenated many small trivialities, so they must be implemented this way (-> simple linear programming style) 2. The program should be easily readable 3. The most complicated thing in the script is the two-dimensional for-loop creating the resulting image (which is not really related to the patent because just the thresholds should be interesting) 4. The program violates nearly all claims simultaneously But for comfort, the program additionally violates 2 further patents (EP0129439 and EP0266049), and I found two formal mistakes which lead to corrected implementations of the patent not to be "protected" by the patent. About the code: The Python-Script, using the Python Imaging Library (PIL, for reading and writing of image files), would be started with two command line parameters specifying the source image file and the destination base name (e.g. "dest" for "dest.jpg"). The respective gray scale image will be read in (line 5), its histogram (line 6) and the median (from l.12) computed, the mentioned extrema calculated (l.19, where I used 0.05 = 5% as the significant amount, method from claim 5), the background and foreground colors computed (from l. 36) and the edge (l.42) and thresholds determined (l.44). Everything from line 48 on is not really needed, because the conversion itself isn't the main point, in favor of the threshold determination. Every- thing else is just for demonstrational purposes and debugging. :) By the way, this program violates at least 2 further patents, EP0129439 (LZW-Compression) und EP0266049 (JPEG-Encoding), because the resulting image will be saved as JPG and in GIF-Format (with LZW-Compression). HINT: In the claims 1 and 6 the notations "background (color) extreme" and "foreground color extreme" resulting from the real start and end of the histogram, are confused, where the calculation of the edge between the foreground and the background is discussed. The following facts show this: 1. The mentioned claims are illogical 2. The issue is described twice in the description of the patent the other way round 3. The drawing is also the other way round 4. There would occur errors when implementing the original version 5. The resulting image possibly wouldn't be of any use (black / white image) So the mentioned program violates nearly all claims, because it directly implements all the claimed methods and in symbiosis with a multi purpose computer it works as the claimed apparatus. When exchanging the ratios (1/8, 1/4, 1/2) ind lines 44 to 46 with 3/16, 3/8, 3/4, we would also violate the claims 4 and 9. (see threshold2.py) -> 10 violated claims, 2 logical mistakes, 2 further patents violated :) Roland Stigge