Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Change color of jpg image to any other color by modifying its R,G, B contents

say I have  a image -simple red rectangular block. If I want change it color to say blue or any other color by modifying its R,G, B contents, is there a simple solution?

I tried some ideas but doesn't work.

Any help will be appreciated.

Thanks

0 Kudos
Message 1 of 6
(4,877 Views)

It seems that you are going to have to modify the image data of the picture file. There are some examples of this on the community website. Depending on the bit depth of the image the following example may not work. You should be able to modify this example to take in a jpeg with (Read JPEG File.vi).

 

http://decibel.ni.com/content/docs/DOC-4884

 

<Joel Khan | Applications Engineering | National Instruments | Rice University BSEE>


0 Kudos
Message 2 of 6
(4,861 Views)

Hi,

 

You can extract Hue plane of the color image, modify the extracted plane and replace it back to original image.

 

Vance

 

0 Kudos
Message 3 of 6
(4,850 Views)

Thanks for the reply.

I think with IMAQfill I can get this job done...

0 Kudos
Message 4 of 6
(4,808 Views)

Glad to hear you figured it out


0 Kudos
Message 5 of 6
(4,797 Views)

I also was able to write up an example which modify the amounts of Red, Green, and Blue. This example extracts the red, green, and blue hue planes from a 32 bit RGB image. I have imported an IMAQ shipping example image from file.I put it on the community website. 

http://decibel.ni.com/content/docs/DOC-14557

 

<Joel Khan | Applications Engineering | National Instruments | Rice University BSEE> 


0 Kudos
Message 6 of 6
(4,795 Views)