topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 7:23 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: switch black and white in tiff files  (Read 15778 times)

eleman

  • Spam Killer
  • Supporting Member
  • Joined in 2009
  • **
  • default avatar
  • Posts: 413
    • View Profile
    • Donate to Member
switch black and white in tiff files
« on: January 23, 2013, 02:22 AM »
I'm looking for a simple software to switch colors in b&w tiff files. There are hundreds of pages of documents scanned weirdly, with the background in black, and the text in white. I need to print them, but the black background would make me bleed ink.

So if only I can find an utility to make blacks white, and whites black... In batches preferably.

Any ideas?

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,288
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: switch black and white in tiff files
« Reply #1 on: January 23, 2013, 02:27 AM »
Not a solution, but an idea - would you be able to write a script in the GIMP or Photoshop to do it?
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,288
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: switch black and white in tiff files
« Reply #2 on: January 23, 2013, 02:30 AM »
Oh - another thing - are the TIFFs multi-page images or single images?
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

eleman

  • Spam Killer
  • Supporting Member
  • Joined in 2009
  • **
  • default avatar
  • Posts: 413
    • View Profile
    • Donate to Member
Re: switch black and white in tiff files
« Reply #3 on: January 23, 2013, 02:32 AM »
TIFFs are multi-page images.

Actually, I can come up with a gimp script. That's a good idea. I should have thought of it. Thank you very much.

vlastimil

  • Honorary Member
  • Joined in 2006
  • **
  • Posts: 308
    • View Profile
    • Donate to Member
Re: switch black and white in tiff files
« Reply #4 on: January 23, 2013, 02:35 PM »
My memory is not what it used to be, but there may be a flag in tiff files that indicates what is black and what is white. Could it be that the software you are using for viewing the files ignores it? Maybe the files are OK (and maybe not).

eleman

  • Spam Killer
  • Supporting Member
  • Joined in 2009
  • **
  • default avatar
  • Posts: 413
    • View Profile
    • Donate to Member
Re: switch black and white in tiff files
« Reply #5 on: January 23, 2013, 03:11 PM »
My memory is not what it used to be, but there may be a flag in tiff files that indicates what is black and what is white. Could it be that the software you are using for viewing the files ignores it? Maybe the files are OK (and maybe not).

It appears that this is the case. Faststone maxview shows the files with white text on black background. Gimp, on the other hand, shows them as one might expect. I was able to print them correctly from gimp.

Renegade

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 13,288
  • Tell me something you don't know...
    • View Profile
    • Renegade Minds
    • Donate to Member
Re: switch black and white in tiff files
« Reply #6 on: January 23, 2013, 08:47 PM »
Black is white and white is black?  :huh:

Gotta say, it's almost comical. :D
Slow Down Music - Where I commit thought crimes...

Freedom is the right to be wrong, not the right to do wrong. - John Diefenbaker

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,017
    • View Profile
    • Donate to Member
Re: switch black and white in tiff files
« Reply #7 on: January 23, 2013, 10:17 PM »
Xnview has a batch convert mode, and a function to invert colors.  Set your folders, select the files and apply the "Negative" function.  I used it all the time when I was scanning images of construction plans and came across the old ones that were purple with white lines.  The machine I was using scanned in black and white to tiff, so it was perfect.
It can handle multi-page tiffs as well.

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,641
    • View Profile
    • Donate to Member
Re: switch black and white in tiff files
« Reply #8 on: January 23, 2013, 10:24 PM »
It can handle multi-page tiffs as well.

Strange, I thought of XnView yesterday when I read the thread but when I tried a multipage TIFF, (that I created for the test), it resulted in a TIFF with the first page only.

Edvard

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 3,017
    • View Profile
    • Donate to Member
Re: switch black and white in tiff files
« Reply #9 on: January 24, 2013, 12:27 AM »
Weird, I swear I saw an option for that in the batch processing dialog in plain XnView, but apparently not.  It is in XnViewMP though: http://newsgroup.xnv...php?f=60&t=26033 
From Tools -> Batch Convert, on the 'Output' tab, in the 'Multipage' group box, check the boxes next to "Convert multipage file to multipage file (when possible)" and "Convert all pages from multipage file".

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,540
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: switch black and white in tiff files
« Reply #10 on: January 24, 2013, 02:28 AM »
@eleman: If your .tif/.tiff image file contains an image of white text on a black background, and you want it reversed, then I would suggest that you might consider turning the image into a negative (e.g., using irfanview or similar), which can then be saved as an image of black text on a white background.
That's what I have usually done in the past anyway.

You can print/output such image files as PDF files, and OCR them in the process, so you will have them as text-searchable and text copyable PDF files, which might be handy for searching/reading on a PCscreen, and could be easily printed as black-on-white hardcopy.

...I need to print them...
However, I have to ask: Why do you need to print them in hardcopy?
It does seem a backwards step.

Some alternatives:
  • 1. Windows 7 search/index: If the .tif/.tiff files were output from document scans, then whether the text is black on white or white on black should make little difference to an OCR scan. If you have any .tif/.tiff files on disk in Windows 7 (Home Premium), and if they are in a Library that the inbuilt index/search service has been assigned to watch, then the files will be automatically OCR scanned, and and any text in the images will be indexed and becomes text-searchable (but not text-copyable) - e.g., from the Start menu Search all programs and files.

  • 2. Google Drive: If you put the .tif/.tiff files into Google Drive, then the files will be automatically OCR scanned, and any text content will be indexed and made text-searchable and text-copyable. I use that facility all the time in Gdrive, and it seems to work very well.

  • 3. Qiqqa: If you output the image files as .PDF files, and if they were not OCR scanned, (or even if they were) then you could use the FREE version of the reference management system Qiqqa, which can automatically OCR scan PDF image files, and outputs indexed text-searchable and text-copyable PDF files. It is a superb information management tool.

Hope this helps or is useful.

eleman

  • Spam Killer
  • Supporting Member
  • Joined in 2009
  • **
  • default avatar
  • Posts: 413
    • View Profile
    • Donate to Member
Re: switch black and white in tiff files
« Reply #11 on: January 24, 2013, 02:47 AM »
...I need to print them...
However, I have to ask: Why do you need to print them in hardcopy?
It does seem a backwards step.

Court business. The documents must be printed and placed in dockets. And I will not attempt to reform Turkish civil procedure code at this time. Maybe later.

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,540
  • @Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: switch black and white in tiff files
« Reply #12 on: January 24, 2013, 03:39 AM »
Court business. The documents must be printed and placed in dockets. And I will not attempt to reform Turkish civil procedure code at this time. Maybe later.
I should have known.    :(
No matter, I suggested some potentially useful options for getting what you need, with no extra cost or coding required, so you can probably get your B-on-W hardcopy no problem.