Select interpretation when initializing the image
Zoulinx opened this issue · comments
zoulinxin commented
Can interpretation be added to pyvips.Image.new_from_file(src.path, access='sequential') as in new_from_array?
If there's an alternative method, please let me know, and I'll be extremely grateful!
John Cupitt commented
Hi @Zoulinx,
You can set interpretation
using copy()
, for example:
image = pyvips.Image.new_from_file(filename).copy(interpretation="xyz")
See:
https://libvips.github.io/pyvips/vimage.html?highlight=copy#pyvips.Image.copy
https://www.libvips.org/API/current/libvips-conversion.html#vips-copy