use paintEvent to paint the image
save 8-bit image
add preview image
add save and saveas
reset brush