## NAME

         luminance_Image - creates a grayscale  image  from  a  color
         image

## SYNOPSIS

          #include <math.h>
          #include <stdio.h>
          #include "CVIPimage.h"
          #include "CVIPluminance.h"

         Image *luminance_Image(Image *inIm)

          <inIm> - a pointer to an Image structure

## PATH

          $CVIPHOME/COLOR/luminance.c

## DESCRIPTION

         Performs an  RGB to luminance  transform  according  to  the
         formula
                       P = 0.299 r + 0.587 g + 0.114 b.

## TYPES AND CONSTANTS

         None

## RETURN VALUES

         A pointer to luminance transformed image.

## HISTORY

         History information recorded: None

## EXAMPLE

               #include <CVIPtoolkit.h>
               #include <CVIPdef.h>
               #include <CVIPimage.h>
               #include <CVIPconvert.h>
               #include <CVIPimage.h>

               #include <math.h>
               #include <stdio.h>
               #include "CVIPluminance.h"

               void main()
               {
               Image *cvipImage;
               IMAGE_FORMAT format;
               char *inputfile, *outputfile;
               setDisplay_Image("picture", "Default");

               print_CVIP("\n\n\t\tThis function requires");
               print_CVIP("\n\t\ta color image.\n\n");
               print_CVIP("\n\t\tEnter the Input File Name:  ");
               inputfile =(char *) getString_CVIP();
               format = getFormat_CVIP(inputfile);
               cvipImage = read_Image(inputfile, 1);

               print_CVIP("\n");
               cvipImage = (Image *)luminance_Image(cvipImage);
               fflush(stdin);

               print_CVIP("\n\t\tEnter the Output File Name:  ");
               outputfile = getString_CVIP();
               write_Image(cvipImage,outputfile,CVIP_NO,CVIP_NO,format,1);
               display_Image(outputfile,format);
               free(inputfile);
               free(outputfile);
               }

## BUGS

         None at this time

## SEE ALSO

         libcolor, lum_average

## AUTHOR

         Copyright (C) 1996 SIUE - by Scott Umbaugh and Arve Kjoelen.