Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > NZ Computing > Counting Pixels

Reply
Thread Tools

Counting Pixels

 
 
Lindsay.Rollo@paradisedotnetdotnz
Guest
Posts: n/a
 
      12-04-2009
Is there a simple way to determine the number of black pixels in
a specimen text block?

I want to compare the differences in the number of pixels used to
display the specimen text block in different type faces.
 
Reply With Quote
 
 
 
 
Lawrence D'Oliveiro
Guest
Posts: n/a
 
      12-04-2009
In message <>,
Lindsay.Rollo@paradisedotnetdotnz wrote:

> Is there a simple way to determine the number of black pixels in
> a specimen text block?


render(the_text, pixbuf);
nrblack = 0;
for (row = rowmin; row < rowmax; ++row)
{
for (col = colmin ; col < colmax; ++co)
{
if (getpixel(pixbuf, row, col) == black)
{
++nrblack;
} /*if*/
} /*for*/
} /*for*/

 
Reply With Quote
 
 
 
 
Lindsay.Rollo@paradisedotnetdotnz
Guest
Posts: n/a
 
      12-04-2009
I was hoping someone woul;d know a readily available program that
would give me the answer, as I'm not a programmer.
 
Reply With Quote
 
Craig Sutton
Guest
Posts: n/a
 
      12-04-2009

"Lawrence D'Oliveiro" <_zealand> wrote in message
news:hfack1$5oq$...
> In message <>,
> Lindsay.Rollo@paradisedotnetdotnz wrote:
>
>> Is there a simple way to determine the number of black pixels in
>> a specimen text block?

>
> render(the_text, pixbuf);
> nrblack = 0;
> for (row = rowmin; row < rowmax; ++row)
> {
> for (col = colmin ; col < colmax; ++co)
> {
> if (getpixel(pixbuf, row, col) == black)
> {
> ++nrblack;
> } /*if*/
> } /*for*/
> } /*for*/
>


NERD for knowing that

 
Reply With Quote
 
Lawrence D'Oliveiro
Guest
Posts: n/a
 
      12-04-2009
In message <hfapif$dq5$>, Craig Sutton wrote:

> "Lawrence D'Oliveiro" <_zealand> wrote in message
> news:hfack1$5oq$...
>
>> In message <>,
>> Lindsay.Rollo@paradisedotnetdotnz wrote:
>>
>>> Is there a simple way to determine the number of black pixels in
>>> a specimen text block?

>>
>> render(the_text, pixbuf);
>> nrblack = 0;
>> for (row = rowmin; row < rowmax; ++row)
>> {
>> for (col = colmin ; col < colmax; ++co)
>> {
>> if (getpixel(pixbuf, row, col) == black)
>> {
>> ++nrblack;
>> } /*if*/
>> } /*for*/
>> } /*for*/
>>

>
> NERD for knowing that


That’s right, I forgot this is actually nz.knitting. My abject apologies for
posting something related to how you actually use computers.
 
Reply With Quote
 
Lawrence D'Oliveiro
Guest
Posts: n/a
 
      12-04-2009
In message <>,
Lindsay.Rollo@paradisedotnetdotnz wrote:

> I was hoping someone woul;d know a readily available program that
> would give me the answer, as I'm not a programmer.


Hire a programmer, then.
 
Reply With Quote
 
Me
Guest
Posts: n/a
 
      12-06-2009
Lawrence D'Oliveiro wrote:
> In message <>,
> Lindsay.Rollo@paradisedotnetdotnz wrote:
>
>> I was hoping someone woul;d know a readily available program that
>> would give me the answer, as I'm not a programmer.

>
> Hire a programmer, then.
>

If the OP wants a windows executable to do the job, post again here and
I'll make one for free and upload it.
It will take little time to do, yet be more productive than Larry D'O's
entire career on usenet.



 
Reply With Quote
 
Lindsay.Rollo@paradisedotnetdotnz
Guest
Posts: n/a
 
      12-06-2009
Me <>::

>If the OP wants a windows executable to do the job, post again here and
>I'll make one for free and upload it.


Thank you for your offer, which I accept.

You could attach the executable to an email to



I'm primarily interested in counting black pixels, but can you
will make provision for counting any color?

Cheers


 
Reply With Quote
 
Me
Guest
Posts: n/a
 
      12-06-2009
Lindsay.Rollo@paradisedotnetdotnz wrote:
> Me <>::
>
>> If the OP wants a windows executable to do the job, post again here and
>> I'll make one for free and upload it.

>
> Thank you for your offer, which I accept.
>
> You could attach the executable to an email to
>
>
>
> I'm primarily interested in counting black pixels, but can you
> will make provision for counting any color?
>

Just emailed it to you, exe file in a zip, about 215kb.
Very basic rough & ready, but works okay. To use, open a bitmap file by
clicking "Open bmp file..." button.
(not sure how you wanted to do it, but loading image as bitmap was
simplest, so you might need to save your image as a bitmap first)
Default colour of pixels to count is black, result displayed when file
loaded.
Click anywhere on displayed bitmap image to select a different colour to
"count pixels", and show result.
 
Reply With Quote
 
Me
Guest
Posts: n/a
 
      12-07-2009
Me wrote:
> Lindsay.Rollo@paradisedotnetdotnz wrote:
>> Me <>::
>>
>>> If the OP wants a windows executable to do the job, post again here
>>> and I'll make one for free and upload it.

>>
>> Thank you for your offer, which I accept.
>>
>> You could attach the executable to an email to
>>
>>
>>
>> I'm primarily interested in counting black pixels, but can you
>> will make provision for counting any color?
>>

> Just emailed it to you, exe file in a zip, about 215kb.
> Very basic rough & ready, but works okay. To use, open a bitmap file by
> clicking "Open bmp file..." button.
> (not sure how you wanted to do it, but loading image as bitmap was
> simplest, so you might need to save your image as a bitmap first)
> Default colour of pixels to count is black, result displayed when file
> loaded.
> Click anywhere on displayed bitmap image to select a different colour to
> "count pixels", and show result.



Your email bounced the attached zip file. Have uploaded to server and
sent you a link to download it.
Cheers.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why don't Sony and Pentax have this problem? Dead pixels, defective pixels RichA Digital Photography 9 04-12-2011 08:54 AM
Re: counting pixels Enkidu NZ Computing 0 08-09-2008 01:15 AM
Can hot pixels become dead pixels? kl_tom Digital Photography 4 10-05-2006 06:52 PM
Pse explain "3.1m effective pixels and 6.0m redorded pixels" notreallyme Digital Photography 14 12-28-2003 03:41 PM
What's the difference between effective pixels and recorded pixels? Mark Grady Digital Photography 10 09-28-2003 11:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57