implement pixel detection