Solved

Detecting if a B\W BitMap image is Inverted

Posted on 2013-11-21
6
241 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
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 42

Expert Comment

by:Rob Jurd, EE MVE
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 44

Expert Comment

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

Expert Comment

by:Rob Jurd, EE MVE
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Latency in .net app using DB in .net 21 65
How useful is the free version of Selenium? 3 34
VB.NET 2008 Publish Error 2 27
Convert datetime to time string 10 21
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

770 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