I am using IrfanPaint constantly but I am not sure how to interpret the tolerance settings. For example: When the tolerance is 24, does that mean +24 and -24 pixels from the current setting or +12 and -12. it would really help to know. Thanks
Announcement
Collapse
No announcement yet.
The meaning of IrfanPaint tolerance settings?
Collapse
X
-
The tolerance value has nothing to do with distances in pixels, but how close other pixels are to the chosen colour value. A tolerance of zero will only fill pixels of the identical colour.Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486
Irfan Paint • Irfan View Help • IrfanPaint Help • Riot.dll • More Skins • FastStone Capture • Uploads
-
Originally posted by Bhikkhu Pesala View PostThe tolerance value has nothing to do with distances in pixels, but how close other pixels are to the chosen colour value. A tolerance of zero will only fill pixels of the identical colour.
These "index" numbers come from the 256 color grayscale and the terminology is copied from the IrfanPaint palette. Index "200" is indicated when the grayscale color of (200, 200, 200) is selected.
Assume that the color index background is set to 200 and the foreground is set to 143.
If the tolerance is set to 24, does this mean that the color replacer changes any background color between 200 +/-24 (224 to 176) or is it 200 +/-12 (212 and 188)?
Obviously if the tolerance is set to 0, then the change only affects the exact colors specified in the color indexes.Irfanview 4.54, Win 10 Pro 64bit 16gb RAM, Intel UHD graphics
Comment
-
There must be a formula that relates the tolerance to the RGB or HSL coordinates but I have not worked out what it is.
Attached is an HSL color selector wheel that I have overpainted using the Irfanpaint Color Replace tool. You can see what I chose as the foreground and background colors and the area that was replaced with a tolerance setting of 25.
Make what you can of that.
Comment
-
Thanks for an excellent example. The reason I asked here is to save time in creating a color table with grayscale, because it's easier to do. Most of my work is with black & white photos and drawings prior to color photography and printing (19th century). I was hoping that Bhikkhu Pesala would ask Irfan, since he would know and save me the work. If that's not forthcoming, then I will have to create it, and will post the original and the results. This issue has been on my mind for a very long time because I am cleaning and trying reproduce the original shades as accurately as possible, for images I upload to Wikimedia commons.Irfanview 4.54, Win 10 Pro 64bit 16gb RAM, Intel UHD graphics
Comment
-
Before stopping development work on the Irfanpaint plug-in the author made the whole project open source, so if you have some knowledge of C++ you can actually look at the code that is used to do the colour replacement.
The link to it is still on this forum at https://irfanview-forum.de/showthread.php?t=6375
I think the code module is called ColorReplacer.cpp
Comment
-
"Took the bull by the horns" and emailed the question to the developer, and here is his reply:
"The comparison is ultimately done by the similarColor function; two colors are considered "similar" if all their channels differ by less than the threshold. Thus, in a grayscale image if the gray level is 200 and the tolerance is set to 24 it will replace anything between 176 and 224."
I hope it helps others as well.Irfanview 4.54, Win 10 Pro 64bit 16gb RAM, Intel UHD graphics
Comment
-
Thanks for the feedback. I have marked the thread as solved.Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486
Irfan Paint • Irfan View Help • IrfanPaint Help • Riot.dll • More Skins • FastStone Capture • Uploads
Comment
-
Thanks ineuw. I was just coming to the conclusion myself that the tolerance setting must represent a square box in RGB color space.
I used the 8bf filter "Color Cube" to look at the color selector wheel from my post #4 above. Color Cube is a free 8bf filter from Martin Vicanek, that you can use in Irfanview, which provides an amazing visualisation of RGB color space.
The color selector wheel contains all the fully saturated colors and so displays as 3 sides of the cube. Replacing part of it using the Irfanpaint color replace tool at a tolerance of 25 punches a neat square hole in the side of the cube. In the second image attached below the cube has been rotated so that it is face on to the green side and displayed at 100% zoom. The side of the cube then measures 256x256pixels and the hole measures 50x50 as expected.
Last edited by Mij; 31.01.2016, 08:55 PM. Reason: Tolerance should be 25 not 20. Extra view of cube added.
Comment
Comment