You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function ppmsave() can be used together with a format option to explicitely specify the output file format. Setting this to either ppm, pgm,pbm or pnm one would expect to get an image file containing integer data but unfortunately all variants of the format option are producing PFM files if the vips image data format is float.
While the PFM file format would be useful to preserve data precision it is very uncommon (actually an extendion to the Netpbm formats) and not much supported by other tools (even GNU find does not recognize it). I believe it would be favourable to store integer image data in PPM,PGM,PBM,PNM files. The output file format should therefore be decided on the output file extension or format option (if any other extension is used) and not deduced from the vips image data format. In turn, PFM files should only be created if using the pfm extension or corresponding format option.
When implicit casting to integer formats is required one has to consider the number of bits per pixel (per band) as well. It might therefore be useful to extend the meaning of the bitdepth option and allow values 8 and 16 as well and use this for data range clipping.
Best regards,
Thomas
EDIT: Forgot to mention that I am working with libvips 8.14.1. The format option has been introduced in 8.12.
The text was updated successfully, but these errors were encountered:
The function ppmsave() can be used together with a
format
option to explicitely specify the output file format. Setting this to either ppm, pgm,pbm or pnm one would expect to get an image file containing integer data but unfortunately all variants of the format option are producing PFM files if the vips image data format is float.While the PFM file format would be useful to preserve data precision it is very uncommon (actually an extendion to the Netpbm formats) and not much supported by other tools (even GNU find does not recognize it). I believe it would be favourable to store integer image data in PPM,PGM,PBM,PNM files. The output file format should therefore be decided on the output file extension or format option (if any other extension is used) and not deduced from the vips image data format. In turn, PFM files should only be created if using the pfm extension or corresponding format option.
When implicit casting to integer formats is required one has to consider the number of bits per pixel (per band) as well. It might therefore be useful to extend the meaning of the
bitdepth
option and allow values 8 and 16 as well and use this for data range clipping.Best regards,
Thomas
EDIT: Forgot to mention that I am working with libvips 8.14.1. The format option has been introduced in 8.12.
The text was updated successfully, but these errors were encountered: