Assigns values to pixels in bitmap based on primality or other conditions