Solved

Detecting if a B\W BitMap image is Inverted

Posted on 2013-11-21
6
244 Views
Last Modified: 2014-02-25
I have a C# .Net application that is converting a BitMap to a Byte[] but need to determine whether the Bitamp is inverted, if so then I need to invert is back.

Can anyone help me with some code examples of both determining whether an image is inverted and invert it back?
0
Comment
Question by:csalerno
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 39668347
>>but need to determine whether the Bitmap is inverted......determining whether an image is inverted

If you do not know somehow (eg. pixel 0,0 is always white in the original so you can test that one pixel in your image) then I would say you are not going to be able to do this task.
0
 
LVL 43

Expert Comment

by:Rob
ID: 39668403
Can't be done. As had been said you don't know what state the image is in ie inverted or normal
0
 
LVL 31

Accepted Solution

by:
Zoppo earned 500 total points
ID: 39668611
Hi csalerno,

where does the bitmap come from? If you load it from a file it may be (i.e. if its a TIFF file) the bitmap has a palette which may indicate black-on-white or white-on-black with the order of the colors in the table.

Beside this I have to agree with the previous comments. The only additional thing which comes in my mind is you could simply count the white and black pixels, if you i.e. have more black than white pixels you can treat it as inverse allthough of course you can't be sure it really is.

ZOPPO
0
Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

 
LVL 44

Expert Comment

by:AndyAinscow
ID: 39884806
so, was it a TIFF file ?
0
 
LVL 43

Expert Comment

by:Rob
ID: 39884816
And I'd say we all deserve a few points eh?
0
 

Author Comment

by:csalerno
ID: 39885443
it was a tiff or a PDF
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question