John Cupitt
John Cupitt
... to explain, `scale` has to scan the image to find the min and max before it can scale the image levels. But if the image has been opened in...
I think the conda build of libvips is rather broken at the moment, so the whole thing needs fixing :( I agree, win support would be very useful.
No problem, thanks for investigating this!
Hi @scossu, XMP is stored as a binary blob, confusingly, rather than as a string. For example: ``` john@yingna ~/pics $ python3 Python 3.6.7 (default, Oct 22 2018, 11:32:17) [GCC...
I think we were unsure about what should be in the public API. Probably `type_from_name` would be a better thing to export, so you'd do: ```python im.set_type(pyvips.type_from_name('VipsBlob'), 'xmp-data', b'my great...
Hello @2h4dl, Yes, `image.get("vips-loader")` should reliably tell you which loader loaded the file. It's not always precise though --- `magickload`, for example, can mean any format supported by ImageMagick (or...
The libvips file type sniffers are all designed around picking a loader, so all you can really get is the name of the load class. You can introspect that in...
I would use something like: ```python def format(image): formats = { "jpegload": "JPEG", "tiffload": "TIFF", etc. } loader = image.get("vips-loader") return formats[loader] if loader in formats else "unknown" ```
Hello @comfortablynick, Sure, there are lots of ways of doing this. For example, you could make a text mask, then scan the image and find the average colour of the...
I made an example for you: https://github.com/libvips/pyvips/blob/master/examples/watermark_context.py It adds a watermark in the bottom left, and automatically picks a contrasting colour. You can use it like this: ``` $ ./watermark_context.py...