graphics utility - converting to 2-color images

S

Spoon2001

I need a utility that is good for converting 8-bit (or higher) images to
1-bit (two color) images. It's essential that I be able to look at a
preview that allows me to change the threshold level, and see what the image
will look like after conversion. Different images require different
threshold levels. Images with a lot of dark stuff in them require a lower
threshold, otherwise you end up with a lot of dark blotches. Images where
the text is too light need a higher threshhold, or else the text will
disappear completely in the resulting image. This sort of thing is common
in scanner TWAIN modules - when you are scanning in line art mode, you can
preview the image before scanning, and then adjust the threshold level
correctly. I need the same thing, but for already existing images files,
not papers I am about to scan.

I tried using Irfanview for this but it's not what I'm looking for. For
example, I can adjust the brightness of an 8-bit image but that's something
entirely different to setting the appropriate threshold for converting the
8-bit image to a 1-bit image.
 
A

Andreas Perfora’tus [Stu]

I need a utility that is good for converting 8-bit (or higher) images
to 1-bit (two color) images. It's essential that I be able to look at
a preview that allows me to change the threshold level, and see what
the image will look like after conversion. Different images require
different threshold levels. Images with a lot of dark stuff in them
require a lower threshold, otherwise you end up with a lot of dark
blotches. Images where the text is too light need a higher
threshhold, or else the text will disappear completely in the
resulting image. This sort of thing is common in scanner TWAIN
modules - when you are scanning in line art mode, you can preview the
image before scanning, and then adjust the threshold level correctly.
I need the same thing, but for already existing images files, not
papers I am about to scan.

I tried using Irfanview for this but it's not what I'm looking for.
For example, I can adjust the brightness of an 8-bit image but that's
something entirely different to setting the appropriate threshold for
converting the 8-bit image to a 1-bit image.

How about using a different approach with Irfanview to do a combination of
adjustments to the gamma, contrast and brightness sliders and grey-scale
conversion to progressively work toward black and white before trying to
convert to 1-bit image. I've been able to do just that and gotten very
satisfactory results by progressions of constantly applying the
improvements to the image until it is only a black and white but still
grey-scale image. Then in the final jump to 1-bit color nothing visibly
changes.

Sorry if it seems not much help, but I do it all the time to make
"photocopy" (ie: 2 color) looking documents from full color scans of
various types of sources including pictures, birth certificates, and many
other textual docs.
 
A

Andreas Perfora’tus [Stu]

Hi Stu,

Thanks for your reply. That's exactly what I'm trying to do too ... I
will definitely try your method. I tried changing brightness and
contrast on the 8-bit image, but didn't have much luck that way. I
couldn't seem to figure out how to do what you did, i.e. make it look
black and white before converting to 1-bit with no visual change.
Maybe the gamma control is the key. If you have any tips on how you
used the brightness, contrast, and gamma to accomplish this, please
pass them along! Anyway since I know that you were able to do it with
Irfanview, I should be able to do it too ... thanks again!

Irfanview is awesome. I just installed GIMP thinking it might help,
but it's not very intuitive to me, so I haven't ever got very far with
it.

Ok, I've played with several color pictures and the general process seems
to be this:

1) convert to grey-scale
2) Click on "Enhance colors" and set Contrast to around 100

3) adjust Gamma and brightness as needed to approach black and white but
keep as much detail as possible - varies depending on the picture/document

4) click "apply to original image" and click ok

5) repeat steps 2,3, and 4 as necessary - sometimes once or twice will be
enough sometimes 3 or 4 times might be needed (you can always click undo or
even re-open the pic if need be)

6) if it looks pretty close to b&w try decreasing color depth to 2-color
(1-bit b&w)

7) if it looks OK to you, you're set. If not, press undo and try 2,3 and 4
again, or even re-open the file and try again from the start.

After a few tries you're sure to develop a rythm or system that works
fairly quickly. I can usually do most of my "conversions" in 20 or 30
seconds anymore.

HTH. :)
 
B

Blinky the Shark

Spoon2001 said:
Irfanview is awesome. I just installed GIMP thinking it might help,
but it's not very intuitive to me, so I haven't ever got very far with
it.

You're in luck.

Since you *have* the GIMP, here's how you do it there -- complete with
the preview you desire:

Open color image.

Rightclick it, and select Image/Mode/Grayscale

Now you have a grayscale image.

Rightclick it and select Image/Colors/Threshhold.

You have a preview (if Preview box isn't checked, check it). Play with
the spinners. Click "OK" when you're happy.

Save. (Rightclick image, File/SaveAs, etc.)
 
S

Spoon2001

Since you *have* the GIMP, here's how you do it there -- complete with
the preview you desire:

Open color image.

Rightclick it, and select Image/Mode/Grayscale

Now you have a grayscale image.

Rightclick it and select Image/Colors/Threshhold.

You have a preview (if Preview box isn't checked, check it). Play with
the spinners. Click "OK" when you're happy.

Save. (Rightclick image, File/SaveAs, etc.)

Blinky - You da shark! Works like a charm!

Stu, you might give the GIMP and Blinky's instructions a try. Might be
easier than converting to 1-bit using Irfanview. I will still try the
Irfanview tricks too.
 
B

Blinky the Shark

DC said:
Blinky the Shark wrote:
Spoon2001 wrote:
You're in luck.
Since you *have* the GIMP, here's how you do it there -- complete with
the preview you desire:

Cool! Tanks. }:O)

I exist but to serve smelly mammals.

I didn't actually remember it. I just figured it had to be there,
somewhere, and went looking for it. Amazing what looking through those
menus will uncover. :)
 
D

DC

Blinky said:
DC said:
Blinky the Shark wrote:
[snip]
Cool! Tanks. }:O)

I exist but to serve smelly mammals.

HEY! *sniff* Oh...
I didn't actually remember it. I just figured it had to be there,
somewhere, and went looking for it. Amazing what looking through those
menus will uncover. :)

So true.

OT question: I thought that x-face was reserved for OPs and the hat was for
followups. Did you change your MO?
 
S

Sietse Fliege

Spoon2001 said:
I need a utility that is good for converting 8-bit (or higher) images
to 1-bit (two color) images. It's essential that I be able to look
at a preview that allows me to change the threshold level, and see
what the image will look like after conversion. Different images
require different threshold levels. Images with a lot of dark stuff
in them require a lower threshold, otherwise you end up with a lot of
dark blotches. Images where the text is too light need a higher
threshhold, or else the text will disappear completely in the
resulting image. This sort of thing is common in scanner TWAIN
modules - when you are scanning in line art mode, you can preview the
image before scanning, and then adjust the threshold level correctly.
I need the same thing, but for already existing images files, not
papers I am about to scan.

I tried using Irfanview for this but it's not what I'm looking for.
For example, I can adjust the brightness of an 8-bit image but that's
something entirely different to setting the appropriate threshold for
converting the 8-bit image to a 1-bit image.

I/Bin may be helpful somewhere in the process :

"I/Bin is a program for intelligent conversion of grayscale raster
images to black & white images (e.g., binarization)."

Download: http://www.egsolutions.com/Download/IBin10.zip

HTH
 
S

Spoon2001

Sietse said:
I/Bin may be helpful somewhere in the process :

"I/Bin is a program for intelligent conversion of grayscale raster
images to black & white images (e.g., binarization)."

Download: http://www.egsolutions.com/Download/IBin10.zip

HTH

Wow ... this program is better than I could have expected. It can produce
much better results than a simple setting of the threshold between 0 and
255. The program includes a sample image, a grayscale drawing, and it is
simply impossible to achieve satisfactory results simply by setting the
threshold and converting to 2-color. But I/Bin evidently employs some
sophisticated algorithms and produced a very good result from the sample
file. Anybody scanning documents would be well advised to have a look at
this program.

Thanks again Sietse.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top