2 Replies Latest reply on Jul 25, 2006 1:09 AM by Newsgroup_User

    Image colorization

    Level 7
      Please, help me!
      I have monochrome image (white, black, and variations of gray), and i need
      to colorize it in different colors via Imaging Lingo. If i just put image
      to the stage and set sprite backcolor value, then white ares are filled
      with this color, black and gray areas are blended with this color -
      exactly what i need! But i can't reproduce this effect via Imaging Lingo -
      then i set #bgcolor parameter in copyPixels, all black and gray areas not
      drawn at all. :( How can i get the same effect, as in sprite backcolor
      manipulations, via Imaging Lingo?

      Thanks.


        • 1. Re: Image colorization
          Chunick Level 3
          let's say the image is member("mono_image") and we want to colour it red:

          img = member("mono_image").image.duplicate()
          img2 = image(img.width, img.height, 8)
          img2.fill(img2.rect, rgb(255,0,0)) -- using red
          img.copyPixels(img2, img.rect, img.rect, [#ink: 39])

          -- then, to see what's been done, set the grayscale image to the new, coloured image:
          member("mono_image").image = img.duplicate()
          or create another bitmap member and set it to that:
          mem = new(#bitmap)
          mem.image = img.duplicate()
          • 2. Re: Image colorization
            Level 7
            Thanks, it works!


            "Chunick" <webforumsuser@macromedia.com> wrote in message
            news:ea3g73$1mj$1@forums.macromedia.com...
            > let's say the image is member("mono_image") and we want to colour it red:
            >
            > img = member("mono_image").image.duplicate()
            > img2 = image(img.width, img.height, 8)
            > img2.fill(img2.rect, rgb(255,0,0)) -- using red
            > img.copyPixels(img2, img.rect, img.rect, [#ink: 39])
            >
            > -- then, to see what's been done, set the grayscale image to the new,
            coloured
            > image:
            > member("mono_image").image = img.duplicate()
            > or create another bitmap member and set it to that:
            > mem = new(#bitmap)
            > mem.image = img.duplicate()
            >