Re: How do I add colorize a black & white image?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



If all you are trying to do is apply a red, blue, or green hue that
matches how much grey is in the image that is not too difficult. First
you need to determine what format your gray image is in. This is
because different image formats have different sizes. The BitmapData
class will have the necessary information here. Once you have a
numerical value for how much gray there is you can set the correct
color to that amount. To do that you do the following.

- create an empty Bitmap the same size as your gray one.
- iterate through your gray image using your BitmapData object and get
gray value.
- create a pixel in your empty Bitmap with the same amount of whatever
color you want to set as a hue. The byte you add the value to for the
color is reached with your BitmapData object, but how you find the
right byte depends on the image format you use.
- when you're done save your new Bitmap.

Now, this will only work to add one hue to the image, so you'll go from
a gray image to a red image, or a blue image, etc. Hope that helps,
good luck.

MrNobody wrote:
Thanks justin that is a very helpful link.

Would you happen to know where I can go to form some basic color type
questions?

Like what exactly would I have to do to give each pixel a red color but
darkened/lightened depending on how gray it is? Wouldn't I have to change the
RGB value given depending on the shade of gray the pixel is, so the end
result is not just pure saturated color?

.



Relevant Pages

  • Re: Select Pixels by Hue
    ... Neither the magic wand nor "Color Range" menu seem to give me enough ... select every pixel in an image with an exact hue reading of say 75°. ... undefinable, but in the programming world using HSB or HSV pixels, gray ...
    (comp.graphics.apps.photoshop)
  • Re: gray point algorithm
    ... I select a gray pixel in my image. ... across the R, G, and B channels for that pixel. ... Mention .icc profiles and color management to the Olympus salesman and see ...
    (comp.graphics.apps.photoshop)
  • Re: Drawing floating-point lines with Bresenham
    ... between 2 screens, you can achieve 4 colors (black, white, light gray, ... it goes by saying that if the pixel is lit ... with floating-point endpoints. ... "Zuse, Zuse" sprach die Tante, als das Rechenzimmer brannte. ...
    (comp.graphics.algorithms)
  • gray point algorithm
    ... I need to know what specific calculations Photoshop applies to an ... I select a gray pixel in my image. ... across the R, G, and B channels for that pixel. ...
    (comp.graphics.apps.photoshop)
  • Re: need a simple image builder
    ... the following records are the pixels in this format ... I just wanted the image with grays as pixel values. ... The gray values can be given also one in a line, ... had no problems with a one column plain pgm, ...
    (sci.image.processing)