Do you see an error message in the Messages window? When this happens (the result of an evaluation is more or less the expression you entered), it's usually because it can't be evaluated, e.g. because image2
is not actually an image. If I Import
the image from your post, ColorReplace
accepts it as an argument, but since the blue you're trying to replace isn't exactly Blue
, it doesn't replace anything.
You can use a trick from the ColorReplace
documentation, and look for the closest "bluish" color that's actually in the image, and replace that:
image2 = Import["https://i.stack.imgur.com/lGVPj.png"];
g = Nearest[DominantColors[image2, 10], Blue,
DistanceFunction -> ColorDistance]
ColorReplace[image2, g[[1]] -> White]
,
This mostly works, except that I guess anti aliasing makes parts of the blue line darker than ColorReplace
's threshold. You can play with the threshold (that last parameter), but I think if you only want to make blue pixels white, the easiest way would be to just use the blue channel:
ColorSeparate[image2][[3]]
