Matlab

Moderators: None (Apply to moderate this forum)
Number of threads: 1471
Number of posts: 2147

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Gray value Posted by pagalj on 24 Mar 2009 at 8:06 PM
Hi

Can anyone tell me solution for my following problem.

How to compute the gray value (0 to 255 ) of each pixel , and double the value of that pixel.
If a pixel has a gray value of 150, I want to make that pixel value into 150*2, so that it get’s much darker.

Thank U

Report
Re: Gray value Posted by giug on 25 Mar 2009 at 12:29 AM
If you have an image I in the range [0 255] to double it, you can simply code:

I_double = I*2;

In this way every pixel of the image is doubled.

But if you double the pixel values it become lighter, not darker. And it saturate.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.