Does IMage::write_to_tofile implicitly convert to sRGB? #4130
VivitionDeveloper
started this conversation in
General
Replies: 1 comment 1 reply
-
Hello @CoachRDeveloper, Yes, the savers will implicitly convert the image to one of the formats supported by the image type. So (for example) the jpeg saver will convert to one of: one band mono, three band RGB, or four band CMYK, all of then 8 bit depth. For your code, try (python for brevity): img = img.colourspace("lab")
img *= [1, 1.3, 1.3]
img.write_to_file("xx.jpg")
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I discovered that writing a vips image in LABS colorspace to disk produces same output as when first a convert to sRGB is done. Does this mean that VIMage::write_to_tofile() implicitly converts an image to sRGB?
I've checked vips_foreign_find_save and vips_image_write_to_file, but did not find information about that.
I'm not very familiar to the JPEG format, but according Wiki the color space can be written to the file (remembering things about sRGB vs Adobe RGB when printing photos).
Actually, the code behind this question is how to adjust saturation. Borrowed from another example I created some code like this (thanks to another piece of information, that direct convert to LABS is not possible):
Actually two questions:
Beta Was this translation helpful? Give feedback.
All reactions