enhanced writepixle() to specify a pixel or not, if color=1 write a pixel else write a empty pixel.