Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Detecting if a B\W BitMap image is Inverted

Posted on 2013-11-21
6
Medium Priority
?
253 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 45

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 2000 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 45

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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

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…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

971 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