Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Detecting if a B\W BitMap image is Inverted

Posted on 2013-11-21
6
Medium Priority
?
250 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 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
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

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…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

719 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