Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Graphics
  4. Choose correct pixel (Intertesting problem)

Choose correct pixel (Intertesting problem)

Scheduled Pinned Locked Moved Graphics
graphicsperformancehelptutorial
5 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mah_pankaj
    wrote on last edited by
    #1

    I have a problem when two images are overlapping in a area. Then I have to draw both the images side by side in such a way that they seems to be merging. I am drawing first image and then second image on same memory buffer. Now my problem is how to determine which pixel to draw (old Image/new Image). As to show merging I don't want to overwrite all the pixels of old image with new image. I have four color to play with.(ForeColor, BackColor, Old Memory Buffer Color, New Memory Buffer Color). All the images are color and using grayScale Alpha blending on edges so we will have lots of different color pixel in one image specially on edges. I hope some of graphics designer must have face this problem. Please let me know the approach or some algo to decide. Currently I am using one method to check the new memory color and old memory color distance from foreground color and printing the closer one. Also I did same with background color and printing which is far from background color. These are failing some time specially if I choose foreground and background color same.(Condition :-Main part of both Picture must be using foreground color as this is character text and that part should not be overwritten.). Thanks in advance.

    T 1 Reply Last reply
    0
    • M mah_pankaj

      I have a problem when two images are overlapping in a area. Then I have to draw both the images side by side in such a way that they seems to be merging. I am drawing first image and then second image on same memory buffer. Now my problem is how to determine which pixel to draw (old Image/new Image). As to show merging I don't want to overwrite all the pixels of old image with new image. I have four color to play with.(ForeColor, BackColor, Old Memory Buffer Color, New Memory Buffer Color). All the images are color and using grayScale Alpha blending on edges so we will have lots of different color pixel in one image specially on edges. I hope some of graphics designer must have face this problem. Please let me know the approach or some algo to decide. Currently I am using one method to check the new memory color and old memory color distance from foreground color and printing the closer one. Also I did same with background color and printing which is far from background color. These are failing some time specially if I choose foreground and background color same.(Condition :-Main part of both Picture must be using foreground color as this is character text and that part should not be overwritten.). Thanks in advance.

      T Offline
      T Offline
      Tim Craig
      wrote on last edited by
      #2

      The general problem is called "image stitching" and a lot of software exists to handle stitching photographs into panoramic views. It sounds like your case is less general but the procedures probably are similar.

      You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.

      M 1 Reply Last reply
      0
      • T Tim Craig

        The general problem is called "image stitching" and a lot of software exists to handle stitching photographs into panoramic views. It sounds like your case is less general but the procedures probably are similar.

        You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.

        M Offline
        M Offline
        mah_pankaj
        wrote on last edited by
        #3

        Thanks Tim. This information helped me to find related stuff. But my problem is specially with same foreground and background color. You can think I have some text and each character is surrounded by clouds. Now I need to print these correctly rendered text in buffer so that surrounding cloud of text should be evenly overlapped but it should not overwrite the main text. My problem is mainly with same background and foreground color. Also my current code is very simple and I don't want to use any complex function(which is most of filters are doing) to get the correct pixel.

        T 1 Reply Last reply
        0
        • M mah_pankaj

          Thanks Tim. This information helped me to find related stuff. But my problem is specially with same foreground and background color. You can think I have some text and each character is surrounded by clouds. Now I need to print these correctly rendered text in buffer so that surrounding cloud of text should be evenly overlapped but it should not overwrite the main text. My problem is mainly with same background and foreground color. Also my current code is very simple and I don't want to use any complex function(which is most of filters are doing) to get the correct pixel.

          T Offline
          T Offline
          Tim Craig
          wrote on last edited by
          #4

          Ok, I think I understand your problem a bit better now. Is your text in any kind of regular pattern so that you can use OCR techniques to identify the margins and rows? If so, alignment of the text would be easy based on your layout rules. If there's something special about the background that also needs to be aligned somehow and it's fairly uniform, this sounds more like the problem of finding the back cat in the coal bin at midnight. :)

          You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.

          M 1 Reply Last reply
          0
          • T Tim Craig

            Ok, I think I understand your problem a bit better now. Is your text in any kind of regular pattern so that you can use OCR techniques to identify the margins and rows? If so, alignment of the text would be easy based on your layout rules. If there's something special about the background that also needs to be aligned somehow and it's fairly uniform, this sounds more like the problem of finding the back cat in the coal bin at midnight. :)

            You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.

            M Offline
            M Offline
            mah_pankaj
            wrote on last edited by
            #5

            thanks tim. You are correct about the problem. But I dont have background color as a seprator because of cloud color. Without this clude I am using the fore and back color distance logic to get the correct color. But with this 3rd color problem is :doh: . Up to no efficient solution for this in case anyone can help with more ideas.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups