Velocity Reviews > Counting Pixels

# Counting Pixels

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.

Lawrence D'Oliveiro
Guest
Posts: n/a

 12-04-2009
In message <(E-Mail Removed)>,

> 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*/

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.

Craig Sutton
Guest
Posts: n/a

 12-04-2009

"Lawrence D'Oliveiro" <(E-Mail Removed)_zealand> wrote in message
news:hfack1\$5oq\$(E-Mail Removed)...
> In message <(E-Mail Removed)>,
>
>> 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

Lawrence D'Oliveiro
Guest
Posts: n/a

 12-04-2009
In message <hfapif\$dq5\$(E-Mail Removed)>, Craig Sutton wrote:

> "Lawrence D'Oliveiro" <(E-Mail Removed)_zealand> wrote in message
> news:hfack1\$5oq\$(E-Mail Removed)...
>
>> In message <(E-Mail Removed)>,
>>
>>> 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.

Lawrence D'Oliveiro
Guest
Posts: n/a

 12-04-2009
In message <(E-Mail Removed)>,

> 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.

Me
Guest
Posts: n/a

 12-06-2009
Lawrence D'Oliveiro wrote:
> In message <(E-Mail Removed)>,
>
>> 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
It will take little time to do, yet be more productive than Larry D'O's
entire career on usenet.

Guest
Posts: n/a

 12-06-2009
Me <(E-Mail Removed)>::

>If the OP wants a windows executable to do the job, post again here and

Thank you for your offer, which I accept.

You could attach the executable to an email to

http://www.velocityreviews.com/forums/(E-Mail Removed)

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

Cheers

Me
Guest
Posts: n/a

 12-06-2009
> Me <(E-Mail Removed)>::
>
>> If the OP wants a windows executable to do the job, post again here and

>
> Thank you for your offer, which I accept.
>
> You could attach the executable to an email to
>
> (E-Mail Removed)
>
> 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
Click anywhere on displayed bitmap image to select a different colour to
"count pixels", and show result.

Me
Guest
Posts: n/a

 12-07-2009
Me wrote:
>> Me <(E-Mail Removed)>::
>>
>>> If the OP wants a windows executable to do the job, post again here

>>
>> Thank you for your offer, which I accept.
>>
>> You could attach the executable to an email to
>>
>> (E-Mail Removed)
>>
>> 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
> 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
Cheers.