Color Separation | High Contrast B&W

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, xnview

Post Reply
mikeincousa
Posts: 6
Joined: Mon Mar 04, 2019 1:53 am

Color Separation | High Contrast B&W

Post by mikeincousa » Sat Mar 16, 2019 12:27 am

:D
Hello again,

I am starting to learn the app. Great fun. Great code. Thanks for all the work behind it.

I managed to rotate the attached test image from landscape to portrait. Ultimately I will want to rotate such images in a batch mode.

I am seeking something like a eye dropper (like in Gimp I think?) that I can use to identify a color, then with that HEX value change that color to another one. Maybe I am ahead of myself?

More specifically for the attached test example, I am seeking to turn it into a high contrast B&W image like one would get from a commercial copy machine.

I am seeing three colors: the gray background; the blue URL links; and the lettering. Maybe there are more? Is there a way to get a frequency distribution type mapping of the colors? I could post a *.pdf of the original if that would help: let me know. note parts of the image may not be in the sharpest focus, but that does not matter for this question.

BTW. The contrast is set by the lighting and camera. This is a color rendering. I have not seriously tried the B&W mode yet: it would likely improve the contrast on this image somewhat but I do not think it will directly bring the deep white and deep black very high contrast that I seek. Again ultimately I would like to do this in a batch if possible.

FYI: I am using LED desk lamps for the illumination. This is a first for me. They seem to have a strong blue cast and I am wondering if that is part or all of graying of the image? Maybe there is a way making a global color correction for all such images?

Thanks for any thoughts and your ongoing support.

Michael
Attachments
Reading.chart.2.IMG_6880.jpg

cday
XnThusiast
Posts: 2139
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Color Separatoin | High Contrast B&W

Post by cday » Sat Mar 16, 2019 8:31 pm

mikeincousa wrote:
Sat Mar 16, 2019 12:27 am
I am seeking something like a eye dropper (like in Gimp I think?) that I can use to identify a color, then with that HEX value change that color to another one. Maybe I am ahead of myself?
There is likely a way to see the value of particular pixels, but I don't think there is a way to globally change values using that value; someone please correct me if I'm wrong...

More specifically for the attached test example, I am seeking to turn it into a high contrast B&W image like one would get from a commercial copy machine.
I would normally suggest using a levels adjustment, possibly after converting the image to grayscale. If your images have similar properties, you can then use the optimum settings you determine to batch convert other images. The recently added curves adjustment could also be used if you are familiar with it, but probably isn't needed.

The ultimate result that can be obtained using levels is limited by the evenness of the illumination of the page, but your posted image seems unusually evenly illuminated considering the setup you described. I'm attaching an enhanced copy of your image to give an indication of the results that might be possible.

I am seeing three colors: the gray background; the blue URL links; and the lettering. Maybe there are more? Is there a way to get a frequency distribution type mapping of the colors? I could post a *.pdf of the original if that would help: let me know. note parts of the image may not be in the sharpest focus, but that does not matter for this question.
There should be somewhere, but if levels works well enough that would be the easiest method I think.

FYI: I am using LED desk lamps for the illumination. This is a first for me. They seem to have a strong blue cast and I am wondering if that is part or all of graying of the image? Maybe there is a way making a global color correction for all such images?
I can't advise on that but support should be readily available if you post that question on the dedicated scanning forum I mentioned above, and in general I think you are likely to get more support there than on this forum other than for issues directly related to this software, where few members provide general support.
Attachments
Reading.chart.2.IMG_6880_Levels.jpg

mikeincousa
Posts: 6
Joined: Mon Mar 04, 2019 1:53 am

Re: Color Separatoin | High Contrast B&W

Post by mikeincousa » Fri Apr 05, 2019 3:17 am

Sorry for the long delay in responding. Thank you for your thoughts.

I am a bit confused how you moved from my dark image to your nicely bright one.

Did you use Levels exclusively?

Image>Adjust>Levels?

I see Five options on that page. Which one do I use and which way do I move them to get to the corrected image?

I have a similar problem with needing to globally darken very light pencil marks in an image with a bright white background.

Could you kindly point me in the right direction for that task too?

Thank you for your thoughts and suggestions.

cday
XnThusiast
Posts: 2139
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Color Separatoin | High Contrast B&W

Post by cday » Fri Apr 05, 2019 7:18 am

mikeincousa wrote:
Fri Apr 05, 2019 3:17 am
I am a bit confused how you moved from my dark image to your nicely bright one.

Did you use Levels exclusively?

Image>Adjust>Levels?

I see Five options on that page. Which one do I use and which way do I move them to get to the corrected image?

Levels is a powerful tool that often can achieve directly a result that could be have been achieved in other ways, possibly using multiple actions; in addition the 'MP implementation provides control of 'gamma' in the same action.

The general method is to move the outer sliders in the control below the histogram towards the center, in the case of a photograph typically to the outer edges of the histogram. For a scanned image it's basically trial and error, the way I do it usually starting by moving the righthand slider to the left to reduce or eliminate unwanted gray background. The middle 'gamma' slider can also optionally be used to darken or lighten the overall image. It comes down to a subjective judgement or compromise of what looks best overall: Try it on a scan and you will soon get the general idea.

As previously mentioned, converting an image scanned in colour to grayscale before using a levels adjustment may improve results.

The lower slider marked Output can normally be ignored, and there is much further guidance on using a levels adjustment available online, if you wish to learn more.

I have a similar problem with needing to globally darken very light pencil marks in an image with a bright white background.

Could you kindly point me in the right direction for that task too?

The starting point would probably be to see what can be achieved using a levels adjustment, but there are a range of possible ways of enhancing difficult scans which have been mentioned on the forum in the past: if levels doesn't work, report back and XnTriq in particular with his extensive cross-referencing system may be able to make some suggestions! There are, though, limits on what can be achieved with difficult scans.

mikeincousa
Posts: 6
Joined: Mon Mar 04, 2019 1:53 am

Re: Color Separatoin | High Contrast B&W

Post by mikeincousa » Sat Apr 06, 2019 3:16 am

Thanks for you comments. First is this what you mean by "MP implementation" ?
https://en.wikipedia.org/wiki/OpenMP? I see a tag in the footer with those initials: same concept or another?

After I posted this last night I found some articles for using histograms. I sort of got the idea.
I took a quick look at the tool again. I will need to fiddle a bit with your path. That will be next.

From earlier work I know the term "Gamma" but then as now I do not know what it means in practical terms. Could you offer some thoughts?

The eye chart is not a scan but a photo. Recall that I have some control over the lighting, but it not fully balanced.That is because my supplier is out of stock of the main lamp I used for that image. I will need to wait a couple of months before they have it back in stock again.

This is the main light:
https://www.lampsusa.com/search?type=pr ... ton=Search
I have a cluster of two or three small led goose necks on the opposite side of the copy-board acting as fills. In other shots I am seeming some gradation of the image on the fill side, so I will need to fiddle with that in the correction too.

By accident almost, for a recent demanding macro shot I upped the ASA to the max. I did not fiddle with any of the other camera settings: I simply used the default settings. That seems to have helped that shot. I will need to go back and try the eye chart with a manual setting or bumping up the EV value to see if that will better balance the shot.

Yawn. Bye for now.

Thanks for any thoughts and suggestions.

cday
XnThusiast
Posts: 2139
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Color Separatoin | High Contrast B&W

Post by cday » Sat Apr 06, 2019 6:53 am

mikeincousa wrote:
Sat Apr 06, 2019 3:16 am
Thanks for you comments. First is this what you mean by "MP implementation" ?
https://en.wikipedia.org/wiki/OpenMP? I see a tag in the footer with those initials: same concept or another?
Sorry, I was using 'MP to refer to XnView MP. The point I was making is that the XnView MP implementation of levels very usefully includes gamma a as third control in the main levels interface, unlike the original XnView Classic implementation.

After I posted this last night I found some articles for using histograms. I sort of got the idea.
I took a quick look at the tool again. I will need to fiddle a bit with your path. That will be next.

From earlier work I know the term "Gamma" but then as now I do not know what it means in practical terms. Could you offer some thoughts?
Be clear that I am no expert on using levels or on gamma, if that is indeed the correct term, I just know from experience that it can be a very effective way to enhance images directly, without making multiple adjustments using other controls. But it's very much trial and error to see what works, usually starting in my case with moving the right-most slider inwards to as far as possible remove unwanted background shades. I then use the two other controls to obtain the best overall result, all very subjective. The numeric values of the settings used can then be noted and used in batch processing further images, if desired.

The eye chart is not a scan but a photo.
Yes, I do tend to refer to scans when the images in question are camera images...

Recall that I have some control over the lighting, but it not fully balanced.That is because my supplier is out of stock of the main lamp I used for that image. I will need to wait a couple of months before they have it back in stock again.

This is the main light:
https://www.lampsusa.com/search?type=pr ... ton=Search
I have a cluster of two or three small led goose necks on the opposite side of the copy-board acting as fills. In other shots I am seeming some gradation of the image on the fill side, so I will need to fiddle with that in the correction too.

By accident almost, for a recent demanding macro shot I upped the ASA to the max. I did not fiddle with any of the other camera settings: I simply used the default settings. That seems to have helped that shot. I will need to go back and try the eye chart with a manual setting or bumping up the EV value to see if that will better balance the shot.
You seem to have things in hand, and as previously indicated cameras and lighting systems similar to your setup are widely used for book scanning (and other similar projects, one recent project involving imaging vinyl record labels) on the book 'scanning' forum [they use the term loosely there too!], and support on lighting issues is available there.

User avatar
XnTriq
Moderator & Librarian
Posts: 5434
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Re: Color Separatoin | High Contrast B&W

Post by XnTriq » Tue Apr 23, 2019 10:00 pm

Hello cday
Hello Michael

cday wrote:
Sat Mar 16, 2019 8:31 pm
mikeincousa wrote:
Sat Mar 16, 2019 12:27 am
I am seeking something like a eye dropper (like in Gimp I think?) that I can use to identify a color, then with that HEX value change that color to another one. Maybe I am ahead of myself?
There is likely a way to see the value of particular pixels, but I don't think there is a way to globally change values using that value; someone please correct me if I'm wrong...
ViewShow colour information
ToolsBatch convertActionsAdd actionImageReplace color

cday wrote:
Fri Apr 05, 2019 7:18 am
mikeincousa wrote:
Fri Apr 05, 2019 3:17 am
I have a similar problem with needing to globally darken very light pencil marks in an image with a bright white background.

Could you kindly point me in the right direction for that task too?
The starting point would probably be to see what can be achieved using a levels adjustment, but there are a range of possible ways of enhancing difficult scans which have been mentioned on the forum in the past: if levels doesn't work, report back and XnTriq in particular with his extensive cross-referencing system may be able to make some suggestions! There are, though, limits on what can be achieved with difficult scans.
Forum references: Tests:
    • ImageChange color depth…
      • Greyscale: 256
      • Dithering: None
    • ImageAdjustLevels…
      • Luminosity: 153 | 1.00 | 153
      p155993_1.png
    • ImageChange color depth…
      • Greyscale: 256
      • Dithering: None
    • ImageAdjustEnhance colors…
      • Contrast: 80
      • Gamma: 0.01
      p155993_2.png

Post Reply