Solved

Detecting if a B\W BitMap image is Inverted

Posted on 2013-11-21
6
237 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
Comment Utility
>>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
Comment Utility
Can't be done. As had been said you don't know what state the image is in ie inverted or normal
0
 
LVL 30

Accepted Solution

by:
Zoppo earned 500 total points
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 44

Expert Comment

by:AndyAinscow
Comment Utility
so, was it a TIFF file ?
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
Comment Utility
And I'd say we all deserve a few points eh?
0
 

Author Comment

by:csalerno
Comment Utility
it was a tiff or a PDF
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now