PFM writing support for gray-scale images