libvips / pyvips

python binding for libvips using cffi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Select interpretation when initializing the image

Zoulinx opened this issue · comments

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!

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