Skip to main content
gamedev.net
🔒 Locked

Simple Image Processing idea

Started by rajesh_nest May 27, 2009 at 7:51 AM 0 replies 650+ views
Original Post
rajesh_nest
rajesh_nest
I have an image(texture) with white background, and red,green,blue and yellow colored text over it. Now I need to eliminate text written in yellow and green , when I click the button.I tried implementing with thresolding and filtering, but met with little success. Any ideas.
Jason Z
Jason Z
I don't think you will be able to remove the overlapping areas very easily, since you don't know if they were originally a given color, or if they combined with something underneath it to make its current color (assuming you allow some transparency).

But you should be able to detect a given color by making a per-channel comparison of what you are looking for. Take the magnitude of the difference between the color you are looking for and each pixel's color. Then if all of the magnitudes are zero, then you have a color match (make sure you take the abs(x) to check the magnitude). Then you can set it to the background color, and you won't change any values that partially match the colors.
Jason Zink :: DirectX MVP   Direct3D 11 engine on CodePlex: Hieroglyph 3 Direct3D Books: 

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.