PfmFile vs PNMImage 24bit image (jpeg) read speed

While doing some of the EXR loading in float (in another thread), I tested PfmFile for loading a normal jpeg image into a PfmFile. I found that using the same read() in a PNMImage way faster (1/3 of speed) as doing a read in Pfmfile. Is that normal for the 8bit to float process? Or I am doing something wrong… I will try tomorrow to benchmark doing first a PNMIamge load and then convert to Pfmfile to see if its faster, but definetly if I use it directly is way slower.


If you use PfmFile to read a non-floating-point image, it will first load it into a PNMImage under the hood, and then convert that into a PfmFile. So it will always be slower.

If you have a particular need to load a jpg file into a PfmFile, and the performance is not sufficient for you, please file a feature request on GitHub for us to create an optimized fast path for this process.

I will have two different pipelines for now, one for float images with PfmFile and one for Jpegs/8bit images with PNMImage.