Choose correct pixel (Intertesting problem)
-
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.
-
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.
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.
-
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.
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.
-
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.
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.
-
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.
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.