0 Replies Latest reply on Jun 14, 2007 12:50 PM by axelmos2

    bad quality using copyPixels?

      I have two images with transparent background and same size in a castLib and want to copy them into a new image. So for doing that I create a new image called “my_img” and copy the member "circle_yellow" and the member "circle_red" into it using copyPixels, then I create another new image callet "my_alpha" and copy only the alpha of each circle into it. I use this image to set the alpha of the image "my_img".

      IMAGE 1

      IMAGE 2

      This is the code I use:

      img1 = member("circle_yellow").image
      img2 = member("circle_red").image

      -- IMAGE
      my_img = image(400,400,32)
      my_img.copyPixels(img1, img1.rect, img1.rect)
      my_img.copyPixels(img2, img2.rect, img2.rect)

      -- ALPHA
      my_alpha = image(400,400,8, #grayscale)
      my_alpha.copyPixels(img1.extractalpha(), img1.rect, img1.rect, [#ink : 1])
      my_alpha.copyPixels(img2.extractalpha(), img2.rect, img2.rect, [#ink : 1])

      my_img.usealpha = 1

      member("final_image").image = my_img


      WITH ZOOM: (when the background has the same color of the image you can see the pixels in the borders)

      The result in member "final_image" is one image with transparent background that contains both circles. This is Ok, Works fine, but the problem is the quality. Both circles has white pixels in their borders and I need them to be perfect.

      Does anyone knows a a way to doing this with better quality?