Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Grayscale question

19 views
Skip to first unread message

David Topham

unread,
Aug 19, 2002, 9:33:48 AM8/19/02
to
I don't suppose anyone knows the algorithm used by PSP5 (and above, I
assume) to convert an image to grayscale?

Thanks

David


Ilya Razmanov

unread,
Aug 19, 2002, 9:50:22 AM8/19/02
to

"David Topham" <davetop...@hotmail.com> wrote in message
news:ajqs7u$nf9$1...@rockyflats.ardentsoftware.com...

> I don't suppose anyone knows the algorithm used by PSP5 (and above, I
> assume) to convert an image to grayscale?

I suppose people who developed it know :-)

Anyway, my home-made IUV and YCrCb implementations give zero difference to
PSP's own transform for 97-98% of pixels on several images I tried. Does it
shed any light on things?

Ilyich.
--------------------------------------------------------------------------
Ilya Razmanov (a.k.a. Ilyich the Toad)
http://photoshop.msk.ru/ - Photoshop plug-in filters
"Do not play in or around dumpster. Do not sleep in dumpster. Do not kick
dumpster. Usage of this container for the disposal of human remains may be
a violation of local health ordinances." - Full Throttle
--------------------------------------------------------------------------

David Topham

unread,
Aug 19, 2002, 10:37:20 AM8/19/02
to
Thanks Ilyich.

I must confess I'm no imaging expert, just a software developer (!). My
knlowledge of YCrCb is "it's the color encoding system in JPEGs", and that's
it. However, I can now go and look up the conversion.

All I'm trying to do is show colour bitmaps converted to greyscale in an
application, and I'm looking for something better than the sum of squares
conversion method. That's the method suggested in a couple of programming
books I have, but they don't delve too deeply into imaging. The trouble is,
if you have a lot a bright primary colours in an image, they end up looking
dark and you can't tell the difference between red, green and blue.

Thanks again for your help.

David

"Ilya Razmanov" <ily...@cacr.ioc.ac.ru> wrote in message
news:ajqt7u$2m64$1...@serv2.vsi.ru...

Kris Zaklika

unread,
Aug 19, 2002, 12:41:39 PM8/19/02
to
David Topham wrote:
>
> I don't suppose anyone knows the algorithm used by PSP5 (and above, I
> assume) to convert an image to grayscale?

I'm not making any statements about what is used in any
version of PSP. Here, however, are some simple procedures:

Y = 0.299 x R + 0.587 x G + 0.114 x B

or

Y = 0.212671 x R + 0.715160 x G + 0.072169 x B

where Y is the greyscale value you want. Before you start
flailing about with color conversions, you need to read a
FAQ or two. Here are a couple of places to check out:
ftp://rtfm.mit.edu/pub/usenet/news.answers/graphics/colorspace-faq
http://www.efg2.com/Lab/Library/Color/Science.htm

> Thanks
>
> David

--
----------------------------------------------------------------------
Kris Zaklika Jasc Software, Inc. The
Product Ideas: id...@jasc.com Power
Customer Service: customer...@jasc.com To
Technical Support: tec...@jasc.com Create
----------------------------------------------------------------------

Matti Vuori

unread,
Aug 19, 2002, 12:43:04 PM8/19/02
to
"David Topham" <davetop...@hotmail.com> wrote in
news:ajqvv3$oes$1...@rockyflats.ardentsoftware.com:

> All I'm trying to do is show colour bitmaps converted to greyscale in
> an application, and I'm looking for something better than the sum of
> squares conversion method. That's the method suggested in a couple of
> programming books I have, but they don't delve too deeply into
> imaging.

Just about only formula I have run into is this:
G = 0.287 * R + 0.589 * G + 0.114 * B

I tried it using Channel Mixer and while it doesn't have the means to use
all decimals, the formula seems to give just about the same results as
PSP's default grayscale conversion.

--
Matti Vuori, <http://sivut.koti.soon.fi/mvuori/index-e.htm>

Uni

unread,
Aug 19, 2002, 1:59:03 PM8/19/02
to
Ilya Razmanov wrote:
>
> "David Topham" <davetop...@hotmail.com> wrote in message
> news:ajqs7u$nf9$1...@rockyflats.ardentsoftware.com...
> > I don't suppose anyone knows the algorithm used by PSP5 (and above, I
> > assume) to convert an image to grayscale?
>
> I suppose people who developed it know :-)
>
> Anyway, my home-made IUV and YCrCb implementations give zero difference to
> PSP's own transform for 97-98% of pixels on several images I tried. Does it
> shed any light on things?

Not really. But this does:

Uni wrote:
>
> Kris Zaklika wrote:
> >
> > John wrote:
> > >
> > > "................The Exif (Exchangeable Image File)
> > > format is a JEIDA (Japan Electronic Industry
> > > Development Association) standard that was established
> > > in Oct. 1995, revised in Nov. 1997 as version 2.0, and
> > > revised in June 1998 as version 2.1. Exif is referenced
> > > as a preferred image format for digital cameras in ISO
> > > 12234-1 Photography - Electronic still picture
> > > cameras - Removable memory - Part 1: Basic removable
> > > memory reference model.
> >
> > {snip]
> >
> > > "...........was established in Oct. 1995, " ????
> >
> > This information comes from
> > http://www.pima.net/standards/it10/PIMA15740/exif.htm
> >
> > What does this information mean? In 1995 JEIDA established
> > a Japanese standard, revised it in Nov. 1997 and revised
> > it again in in June 1998. So far, we all have to learn
> > Japanese to get anywhere,
>
> That is pure BS, Kris! I went here:
> http://www.pima.net/standards/it10/PIMA15740/exif.htm
> and downloaded an English .pdf document, dated June 12, 1998,
version
> 2.1.
>
> And JUST because a standard is adopted by ISO does not mean
it's
> WORTHLESS until then.

What, Z', no reply? I didn't think so.

See, Kennedy, you're not alone.

Here's what Paint Shop Pro 7 can do. Talk about GROSS DISTORTION!:

http://community.webshots.com/photo/42670345/47515893EPZDBe

Uni

Joe Fromm

unread,
Aug 19, 2002, 5:38:07 PM8/19/02
to
Try 59% green, 30% red, 11% blue.


"David Topham" <davetop...@hotmail.com> wrote in message

news:ajqvv3$oes$1...@rockyflats.ardentsoftware.com...

Uni

unread,
Aug 19, 2002, 6:11:12 PM8/19/02
to
Joe Fromm wrote:
>
> Try 59% green, 30% red, 11% blue.

Can we try PSP-8, instead? :-)

Hi, Joe. I thought you got canned.

Uni

Ilya Razmanov

unread,
Aug 21, 2002, 4:55:59 AM8/21/02
to

"David Topham" <davetop...@hotmail.com> wrote in message
news:ajqvv3$oes$1...@rockyflats.ardentsoftware.com...

> Thanks Ilyich.
>
> I must confess I'm no imaging expert, just a software developer (!). My
> knlowledge of YCrCb is "it's the color encoding system in JPEGs", and
that's
> it. However, I can now go and look up the conversion.
>
> All I'm trying to do is show colour bitmaps converted to greyscale in an
> application, and I'm looking for something better than the sum of squares
> conversion method. That's the method suggested in a couple of programming
> books I have, but they don't delve too deeply into imaging. The trouble
is,
> if you have a lot a bright primary colours in an image, they end up
looking
> dark and you can't tell the difference between red, green and blue.
>
> Thanks again for your help.
>
> David

Ah, now I understand your problem. Sum of squares or just sum is not a very
good idea. Other people like Kris, Matti and Joe already gave you quite good
suggestions; for somewhat more general understanding of this issue I really
recommend you reading:

http://www.inforamp.net/~poynton/notes/colour_and_gamma/ColorFAQ.html

or even better get any downloadable form of it from

http://www.inforamp.net/~poynton/ColorFAQ.html

This should give you more info than you really need :-)))

Ilyich.
--------------------------------------------------------------------------
Ilya Razmanov (a.k.a. Ilyich the Toad)
http://photoshop.msk.ru/ - Photoshop plug-in filters

"The customer with a knife is always right" - Quohog, the barman, Full
Throttle
--------------------------------------------------------------------------


0 new messages