Replies: 25 comments
-
Hello @jfcalvo, Yes, libvips can read and write EXIF, ICC and XMP chunks to and from webp files. Try eg.:
|
Beta Was this translation helpful? Give feedback.
-
Thanks @jcupitt but I'm using the command line at the moment (version
Maybe it's an option that could be added? |
Beta Was this translation helpful? Give feedback.
-
You can set the profile with:
You're right, we could add a What's the use case? |
Beta Was this translation helpful? Give feedback.
-
Adding one ICC profile (from a limited and defined set of them), by default I set the profile to sRGB 2.1 1996 (as recommended by web browsers in general), but it's also possible to add Adobe RGB 1998 if required (but setting only one is allowed). Do you recommend to use |
Beta Was this translation helpful? Give feedback.
-
The problem with the Suppose you have an sRGB image and save with The |
Beta Was this translation helpful? Give feedback.
-
For example:
Gives: |
Beta Was this translation helpful? Give feedback.
-
The bottom JPG has the wrong profile and looks very oversaturated. |
Beta Was this translation helpful? Give feedback.
-
Ah, are users uploading Adobe98 images with no profiles? I can see that would be a problem. |
Beta Was this translation helpful? Give feedback.
-
.... in which case you'd need:
ie. transform with a98 as both input and output. |
Beta Was this translation helpful? Give feedback.
-
Understood. You are only adding the profile without touching pixels (from a sRGB image) and that's causing the oversaturation in the one with Adobe RGB.
I need to work in the logic a little bit more but you're right that's a possibility. I will use your suggested snippet. I have an additional question. It's possible to use your snippet with the output to Thank you very much John. |
Beta Was this translation helpful? Give feedback.
-
Yes, vips format will keep all the metadata. Personally, I would use python / ruby / php / lua / C# etc. rather than the CLI -- you'll save a huge amount of disc IO and CPU. Of course that's a separate issue. |
Beta Was this translation helpful? Give feedback.
-
Cool, thanks for the clarification.
You're totally right. I'm using Elixir, and sadly there is not a vips NIF library for the language. I'm working in one (still in a super early state). In the meantime I want to have a prototype where I can learn about the library and If I can do all that I need with it. Thanks again. |
Beta Was this translation helpful? Give feedback.
-
Ah, gotcha. Good luck with the binding -- I guess you saw the notes in the docs? https://github.com/libvips/libvips/blob/master/doc/binding.md The jekyll version is truncated, for some reason. |
Beta Was this translation helpful? Give feedback.
-
Not yet, thank you for the link. I'm still playing with the compiler and how NIFs are compiled and integrated into the language. I have been thinking into integrate Lua scripts too as alternative but still not sure. |
Beta Was this translation helpful? Give feedback.
-
Yes, luajit is pretty fantastic. It's really nice having FFI built in -- it avoids a lot of complication with separate compile steps and linking. If only arrays didn't index from one :( |
Beta Was this translation helpful? Give feedback.
-
If you're going to be doing image resize, you should probably read the libvips wiki page, it's surprisingly complex: https://github.com/libvips/libvips/wiki/HOWTO----Image-shrinking Or just use |
Beta Was this translation helpful? Give feedback.
-
I'm using I have another question. I'm not sure if it's possible using the vips command line. I would like to know if it's possible to remove the ICC profile from a image. |
Beta Was this translation helpful? Give feedback.
-
All savers have a You can change fields on vips images with |
Beta Was this translation helpful? Give feedback.
-
Yes, I have been using it, but it remove everything as expected (including EXIF data).
I found it like two days ago but I wasn't sure of the purpose of it. I will try to explore that. Thanks!. |
Beta Was this translation helpful? Give feedback.
-
@jcupitt I have been playing too extracting the ICC profile for the images with For example I can't detect or extract the profile from this gif image even when MacOS preview show This is the output that I get (not
If I try to get the
I have used the following to generate the image:
For
I can't upload the jp2 image because is not supported by GitHub. So looks like we are talking about two different problems:
What do you think can be happening for these two issues? |
Beta Was this translation helpful? Give feedback.
-
I added a I had no idea GIF supported ICC profiles, but you're right, that temple seems to have one. I wonder how they encode it? libvips has its own gif loader and it does not support ICC profiles because giflib and libnsgif do not support ICC profiles (as far as I know). I've no idea about jp2: that's handled by |
Beta Was this translation helpful? Give feedback.
-
Huh looks like there are extension chunks for ICC and XMP: https://chromium.googlesource.com/webm/libwebp/+/v0.3.0-rc6/examples/gif2webp.c#387 libvips supports the NETSCAPE and ANIM chunks, but not the other two. An enhancement for the next libvips perhaps. Could you open a new issue for this? It'll get forgotten otherwise. |
Beta Was this translation helpful? Give feedback.
-
Cool, I think in order to be more homogenous with the other save operators it's a good idea.
It's not totally clear to me what you want to accomplish in that issue but I will write one and you can edit it if necessary. Done here: #1726 |
Beta Was this translation helpful? Give feedback.
-
Any idea on how to resize animated webp? |
Beta Was this translation helpful? Give feedback.
-
Hello @pomirleanu, please open a new issue and upload a sample image. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Any reason why the
webpsave
operator doesn't have a--profile
option likepngsave
andjpegsave
so we can embed ICC profiles?I have been checking the docs of the webp format and looks like is something supported: https://developers.google.com/speed/webp/docs/riff_container#color_profile
Beta Was this translation helpful? Give feedback.
All reactions