# This is what worked for me to be able to write gray image on disk
...
cv_img = bridge.imgmsg_to_cv2(msg, desired_encoding="8UC4") # desired_encoding="passthrough"
cv2.imwrite(os.path.join(args.output_dir, "frame%06i.png" % count), cv_img[:,:,0])
...