Need grayscale to monchrome conversion

Sorry for the non-mfc specific question but could someone point me to an 
article or group that might have info on converting a grayscale bitmap to 
monochrome? I've imported some code from IJG that converts jpg to grayscale 
but I need monochrome on a non-windows system.
Thanks and again sorry for the inconvenience. 


0
MAO
1/14/2005 5:28:40 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
139 Views

Similar Articles

[PageSpeed] 25

isn't a grayscale bitmap also monocrhome by default??

"MAO" <nospamplease.com> wrote in message
news:eC$b85l%23EHA.2568@TK2MSFTNGP10.phx.gbl...
> Sorry for the non-mfc specific question but could someone point me to an
> article or group that might have info on converting a grayscale bitmap to
> monochrome? I've imported some code from IJG that converts jpg to
grayscale
> but I need monochrome on a non-windows system.
> Thanks and again sorry for the inconvenience.
>
>


0
noone1 (387)
1/14/2005 8:04:17 PM
[Dave] "isn't a grayscale bitmap also monocrhome by default??"

[Divya] Obviously not. Monochrome implies that color values are either black
OR white. Absolutely no other shade. Gray-scale has 256 shades in between
black and white. In fact, in this part of world (Southern Asia), people
usually use the term 'black-and-white photograph' which is a misnomer. Those
photographs are actually gray-scale photos :)

--

[Mao] "..info on converting a grayscale bitmap to monochrome.."

[Divya] For a scale of 0-255, set some threashold 'T', say T = 128, and put
all values below T as 0 (black) and all values above T as 1 (or 255 in terms
of shades, this representing white color). This is to be done for each pixel
separately. Vary T as per need. For some international standard of T-value
for monochrome images, you might like to refer to some journal. Having a
user-configurable T will abviously be having it's own advantages.

warm regards,
- Divya
www.ryze.com/go/divyarathore



"Dave" <noone@nowhere.com> wrote in message
news:#bHDDRn#EHA.2196@TK2MSFTNGP14.phx.gbl...
> isn't a grayscale bitmap also monocrhome by default??
>
> "MAO" <nospamplease.com> wrote in message
> news:eC$b85l%23EHA.2568@TK2MSFTNGP10.phx.gbl...
> > Sorry for the non-mfc specific question but could someone point me to an
> > article or group that might have info on converting a grayscale bitmap
to
> > monochrome? I've imported some code from IJG that converts jpg to
> grayscale
> > but I need monochrome on a non-windows system.
> > Thanks and again sorry for the inconvenience.
> >
> >
>
>


0
divya1 (5)
1/15/2005 8:08:50 AM
On Sat, 15 Jan 2005 13:38:50 +0530, "Divya Rathore" <divya@venera.co.in> wrote:

>[Divya] For a scale of 0-255, set some threashold 'T', say T = 128, and put
>all values below T as 0 (black) and all values above T as 1 (or 255 in terms
>of shades, this representing white color). This is to be done for each pixel
>separately. Vary T as per need. For some international standard of T-value
>for monochrome images, you might like to refer to some journal. Having a
>user-configurable T will abviously be having it's own advantages.

Actually, it is a bit trickier than this to get it right. What this does is a form of
posterization, where everything darker than a certain level becomes black and everything
lighter becomes white. It is an understatement to say that the result will be very
unsatisfactory. What you need is a halftoning algorithm. So, for example, suppose you have
a 2x2 pixel array which is uniformly level 128. This could be converted to a 2x2 array of
monochrome pixels 01/10 or 10/01, which has an "average" value of 128. In general,
halftoning is subsumed in the general class of "image convolution algorithms". The problem
is that 2x2 is too small, and 16x16 is too large, and 8x8 is either too small or too
large, etc. Halftoning is tricky, but that's what I'd be googling for if I were faced with
the problem.

I did this and the third hit down was suggestive:

[PDF] Multiresolution, error-convergence halftone algorithm
File Format: PDF/Adobe Acrobat
.... which is implicit in this algorithm, was explicitly used for improving halftone
coding by ... the resolution and dynamic range in half- tone images was ... 
http://josaa.osa.org/ViewMedia.cfm?id=4035&seq=0  - Similar pages 

as was the ninth one:

Look-up-table based halftoning algorithm
.... Illinois. p. 34 Look-up-table based halftoning algorithm. PDF. ... correlated. The
algorithm
improves the halftone image quality compared with screening. ... 
http://csdl.computer.org/comp/proceedings/icip/1998/8821/02/882120034abs.htm - 10k -
Cached - Similar pages 

so I'd start looking with a google search "halftone algorithm".
				joe

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
1/15/2005 9:48:46 PM
Very true. Hope Mao gets the details right.

- Divya
www.ryze.com/go/divyarathore


"Joseph M. Newcomer" <newcomer@flounder.com> wrote in message
news:7f3ju01n3s2h4q9s0k8h8fuh3h4cn4b0gk@4ax.com...
> On Sat, 15 Jan 2005 13:38:50 +0530, "Divya Rathore" <divya@venera.co.in>
wrote:
>
> >[Divya] For a scale of 0-255, set some threashold 'T', say T = 128, and
put
> >all values below T as 0 (black) and all values above T as 1 (or 255 in
terms
> >of shades, this representing white color). This is to be done for each
pixel
> >separately. Vary T as per need. For some international standard of
T-value
> >for monochrome images, you might like to refer to some journal. Having a
> >user-configurable T will abviously be having it's own advantages.
>
> Actually, it is a bit trickier than this to get it right. What this does
is a form of
> posterization, where everything darker than a certain level becomes black
and everything
> lighter becomes white. It is an understatement to say that the result will
be very
> unsatisfactory. What you need is a halftoning algorithm. So, for example,
suppose you have
> a 2x2 pixel array which is uniformly level 128. This could be converted to
a 2x2 array of
> monochrome pixels 01/10 or 10/01, which has an "average" value of 128. In
general,
> halftoning is subsumed in the general class of "image convolution
algorithms". The problem
> is that 2x2 is too small, and 16x16 is too large, and 8x8 is either too
small or too
> large, etc. Halftoning is tricky, but that's what I'd be googling for if I
were faced with
> the problem.
>
> I did this and the third hit down was suggestive:
>
> [PDF] Multiresolution, error-convergence halftone algorithm
> File Format: PDF/Adobe Acrobat
> ... which is implicit in this algorithm, was explicitly used for improving
halftone
> coding by ... the resolution and dynamic range in half- tone images was
....
> http://josaa.osa.org/ViewMedia.cfm?id=4035&seq=0  - Similar pages
>
> as was the ninth one:
>
> Look-up-table based halftoning algorithm
> ... Illinois. p. 34 Look-up-table based halftoning algorithm. PDF. ...
correlated. The
> algorithm
> improves the halftone image quality compared with screening. ...
>
http://csdl.computer.org/comp/proceedings/icip/1998/8821/02/882120034abs.htm
 - 10k -
> Cached - Similar pages
>
> so I'd start looking with a google search "halftone algorithm".
> joe
>
> Joseph M. Newcomer [MVP]
> email: newcomer@flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm


0
divya1 (5)
1/17/2005 6:29:16 AM
Reply:

Similar Artilces:

Need help with SQL tables
After running a security reconcile sa was no longer a user in GP. I received the answer below about re-adding it, but I don't know how to add a userid in to a table. I can't find anything on knowledgebase about this. We don't have the SQL Enterprise Manager but use the SQL 2005 Management Studio Express. Can anyone help me? I just need to know the script that will add it to these tables. Thanks. Tracey D "Therefore it will be just a matter of adding 'sa' USERID into the following tables in DYNAMICS database as a minimum. Once added, use ano...

Help needed to add commets, arrows, etc to existing graph...
I am wanting to add comments and arrows (that look proper) and fill i the area between two lines on a line graph i have created in excel. Ca someone please guide me on how this may be done... I was thinking: i. there may be a way to do it in excel that i am not aware of, ii. there may be another charting program which will draw the chart with all the frills from data exported from excel, iii. there may be another program that allows me to add stuff t already created excel charts, iv. something else. My aim is to export these graphs to word - they will form part of report i am writting. An...

Need Help to create Summary sheet.
Hello: I'm working on Excel2000. In one excel file i have one sheet "MasterData" as show below: ********************************** EMP_CD WORK_DT WORK_HRS ----------------------------------------------------- ASH 8/25/2004 0:00 8 IPH 8/25/2004 0:00 2 IPH 8/25/2004 0:00 2 MAN 8/25/2004 0:00 8 NKH 8/25/2004 0:00 1 NKH 8/25/2004 0:00 2 RXK 8/25/2004 0:00 8 YPG 8/25/2004 0:00 8 NSH 8/25/2004 0:00 8 ASH 8/26/2004 0:00 8 YPG 8/26/2004 0:00 8 IPH 8/26/2004 0:00 8 ********************************** Now, I need to create summary sheet (New Sheet) in same file , whic will show...

need help with formula #2
how to write a formula? if cell =>24 multiple by 22. if cell is <24, multiply 24 by 22, multiply difference by 33 add together -- Kerri Where do I find the difference "Kerri Olsen" wrote: > how to write a formula? > if cell =>24 multiple by 22. if cell is <24, multiply 24 by 22, multiply > difference by 33 add together > -- > Kerri See Help for "IF worksheet function" I can't be more specific without a better description of the alternative calculations. Jerry "Kerri Olsen" wrote: > how to write a formula? > if cell ...

Need help creating macros
Hi there, For whatever reason when our system compiles data into Excel 2003 it creates a worksheet that looks like this (for example): Purple Purple Purple Purple Purple Green Green Green Blue Blue Blue Blue Red Red Red Yellow Yellow Yellow Yellow Yellow Orange Orange Orange Brown Brown Brown Brown Teal Teal Teal Black Black Black Black Grey Grey ...

Need help w/ formula
Is there a formula that will change another cells information w/o having a formula in that particular cell. For instance, the IF(N5=Removed" then J5=0) without putting a formula in j5? No. A cell formula cannot change another cell. You can write code to react to value changes in cell N5 and the *code* can change the value in J5 "Todd Nelson" wrote: > Is there a formula that will change another cells information w/o having a > formula in that particular cell. For instance, the IF(N5=Removed" then J5=0) > without putting a formula in j5? No, you cannot ...

Need Help creating a formula****PLEASE
I am a manager in a big office where agents log into their phones to get calls. We keep track of how many minutes an agent is "logged off" of their phone system. I would like to be able to have a formula to use in Excel to speed up the calculations for this info. Here is what the info looks like that I am given and what I need to calculate: Sunday, December 03, 2006 Agent Login Time Logout Time # of minutes logged out Doe, Jane 6:58am 8:51am (need to find # minutes from 9:39am-8:51am) Doe, Jane 9:39am ...

activies need to roll up from sub-accounts to accounts
activities associated with an account need to rollup through all parent accounts above. Jerry http://www.iBizInitiatives.com ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?m...

Need help with creating rules for autoresponce
Hi, I been trying to learn how to make an automatic replies with outlook. I looked at some tutorials, but it seems that I'm missing some functions. I can't find the "replay with message" action, the closest thing it gives me is a "reply using a specific template". So I try to make a template, but I don't have the option to save as a .oft. I even tried changing the extention of my word file to .oft, but it just turns it into a blank e-mail. I am currently using office 2003 pro. Any help would me greatly appreciated. Thanks in advanced there are steps h...

NEED HELP: Who are MBS Partner here?
To prepare the MBS CRM exam, I need the courseware download from Microsoft Website. I email the MBS, they gave me a link: https://mbs.microsoft.com/customersource/training/materials/ But I can’t login, it says:” The email address you entered was not found in our records. Please check the email address and try again.” Could anyone please directly send me the courseware to prepare the exams? Thanks a lot! Jim Hi Jim That link takes you to a list of the available courseware. You must then order the courseware through a Microsoft Partner, so you best bet is to contact a Learning Soluti...

Need advice on 5.5 migration
Our current setup is all NT4 servers and I am running Exch 5.5. My boss wants a whole new domain created for new servers that we will be getting that will be running 2003 server and exchange 2003 (current servers are too outdated for an upgrade). I have set this up in a test environment and created the trusts and ran the ADMT and things ran fairly smoothly except password issues but that may be another post later. My question is which is the best way to approach this from an Exchange standpoint? Should the 2003 join the existing site or should I create a new exchange site for the 2003?...

Need help storing all my emails before i redo my pc outlook 2003
i have microsoft outlook 2003 on windows xp i need to redo my pc but i dont want to loose my emails and contacts and I have too many things stored in files it'sjust too many things to move one by one thanks iris The file you need to back up is your Personal Folders file (*.pst) It's where all the mail, calendar, contacts etc are stored. Take a look at these pages for info on Outlook data backup: http://www.slipstick.com/config/backup.htm -- Russ Valentine [MVP-Outlook] "IrisR" <anonymous@discussions.microsoft.com> wrote in message news:a1b901c434bd$d94a3940$a...

Formula needed #2
Right all you clever people, I need a formula for my tax spreadsheet who can help me? I'm doing my mileage. I can claim back 40p a mile for the first 4,00 miles, then 25p a mile after that. I've been using this formula for the 40p a mile: =D75*0.4 (D75 bein the "total miles" cell) Fairly straightforward, but how do I make it so it adds 0.4 for th first 4,000 then 0.25 for everything after that. Is this possible? Thanks in advance -- dancingbear7 ----------------------------------------------------------------------- dancingbear72's Profile: http://www.excelforum.co...

Need WAN0distributed filesystem... Groove Server?
I have a client with a workforce that are geographically distributed, and as such, doesn't have a single office where all users are located. They have a few servers, including an AD domain, and we have been using the Frontpage Server Extensions of IIS5 (Server 2k3) on their data server to share files over the WAN, but Windows 7 and the newest version of Mac OS X don't appear to be working properly with the (admittedly cheesy) FPSE solution. The way they were doing it, they just added a "My Network Place" to their XP installations that pointed to http://server....

HTREEITEM variables need to be defined as STATIC?
Does HTREEITEM variables need to be defined as STATIC, otherwise after calling the CTREECTRL member function, the variable's value will be changed? Thanks for your answer. >Does HTREEITEM variables need to be defined as STATIC, otherwise after >calling the CTREECTRL member function, the variable's value will be >changed? Generally the answer is no, but it'd be clearer if you showed some example code that you're worrying about. Dave ...

Need help with Multi-workbook COUNTIF formula!!
I have monthly worksheets that use drop down boxes to pick criteria from lists. The linked cell outputs a number based on what the chosen criteria was in the drop down box. Currently I use this outputted number on a summary sheet with a COUNTIF formula ie COUNTIF(Sept!$R$3:$R$200,2) to summarize monthly info. I would like to generate yearly info instead without having to generate monthly totals first. Is there a formula that can use both ranges - Jan:Dec and $R$3:$R$200 - with the criteria of the linked cell ie. 2? ...

New comp. running XP; NEED Publisher from 98SE; How?
HELP! I just got my 1st new comp. & it runs XP however I NEED Publisher from the 98SE... How can I get this program onto this comp. ASAP? I have 2 newsletters for my church that I can't work on until I get this straightened out! Cheryl Smith <Cheryl Smith@discussions.microsoft.com> was very recently heard to utter: > HELP! I just got my 1st new comp. & it runs XP however I NEED > Publisher from the 98SE... How can I get this program onto this comp. Publisher does not come with any version of Windows, it is a separate application. The Publisher that is/was on the ...

need help with payees
On the "spending by payee" report page, it tells me I have 26 transactions, totalling $0 that don't have assigned payee names. All of these transactions are transfers to and from certain accounts. (i'm talking only about transfers here) for example, I transfer $200 "to" my cash account each week. On the"assign payee" page, it shows that transaction twice -- once going 'into' cash, and once going 'out' of checking. Does each occurence of that transaction need a payee? And, who is the payee? And what about other transfers, like from s...

simple (i think) UDF debug help needed
This is my first time writing a new UDF :) The error reported by debug is: "Block IF without End IF" the highlight is on "next i" Function con_check(con_old, con_now) Dim i As Integer Dim targ As Integer Dim hit As Integer Dim roll As Integer If con_old < con_now Then For i = 1 To con_count hit = hit + 1 If hit < 3 Then targ = 1 + hit If 3 < hit < 6 Then targ = hit + 6 If hit > 5 Then myCell.Value = "DEAD" End If End If...

X axis needed for Line Chart
-- FL ...

Conversion of lotus notes address book to microsoft outlook contacts
I just bought Microsoft Outlook. I have all my addresses in Lotus Notes. Is there a way to import the addresses into Microsoft Outlook contacts? ...

Need query to return absence of record
Hello all, hope everyone is doing well this fine morning! I need some help in constructing a query. I have three tables, designed as so: Personnel FullName(PK) Department Classes ClassName(PK) TrainingHistory *Junc table between Personnel and Classes* FullName(FK) ClassName(FK) DateTaken TrainingHistory records every instance of a class taken by all personnel. I need to be able to find people who HAVE NOT taken a given class. I need to be able to pick what class I search for each time I do the query. For example, I need to know who in the organization has NOT t...

Need site for VB Tutorial
Hello Can someone suggest some site to learn VB?? Thanks Tom -- SMIL ----------------------------------------------------------------------- SMILE's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=488 View this thread: http://www.excelforum.com/showthread.php?threadid=26676 Hi see: http://www.mvps.org/dmcritchie/excel/getstarted.htm -- Regards Frank Kabel Frankfurt, Germany "SMILE" <SMILE.1dp2ta@excelforum-nospam.com> schrieb im Newsbeitrag news:SMILE.1dp2ta@excelforum-nospam.com... > > Hello > Can someone suggest some site to learn VB...

Need to extract XML or SGML entities from a Unicode text
I'm working on a list of japaneese entities that contain the entity, the unicode hexadecimal code and the xml/sgml entity used for that entity. A unicode document is read into the program, then the program sorts out every doublet and the hexadecimal unicode code is extracted, but I dont know a way to find the xml or sgml-entity equivalent to the unicode code. Anyone who could give me a pointer? Best regards Frantic wrote: > I'm working on a list of japaneese entities that contain the entity, > the unicode hexadecimal code and the xml/sgml entity used for that > entity. ...

I need a bezier curve the example? Who may provide? Extremely thank!
I need a bezier curve the example? Who may provide? Extremely thank! ...