-
-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vips resize corrupts image #1499
Comments
The 8-bit one is fine, but the 16-bit one is not saving LABS back to 16-bit TIF correctly. I'll have a look, thanks for the report. |
Negative L in LABS needs to be trimmed off before savingf as TIFF. Thanks angelmixu. See #1499
OK, fixed in master, thanks for the report! |
Thanks for the quick fix! :) For me, the failing_vips_resize_8bit-out.tif file, was the one I can't open on Photoshop. |
The 8-bit one is saved as float TIFF, which photoshop does not support. |
You can turn float LAB into 8-bit LAB like this:
|
Oh :/ |
Negative L in LABS needs to be trimmed off before savingf as TIFF. Thanks angelmixu. See libvips#1499
libvips does not usually recode explicitly -- it's done by the savers and only when needed. This case is odd because TIFF supports both 8-bit and 32-bit LAB, so there's an ambiguity. Let's add a recode as a nasty and hacky special case just for resize, since that must be the most common case. |
Thanks! The other issue is this one: #1473 I'm wondering if there could be a generic solution to both cases, but can't think of one right now :/ |
The "squash" option to tiffsave now also squashes 32-bit 3-band float CIELAB images down to 8 bits. See #1499
I changed my mind -- it was too hacky. Instead, the "squash" option to tiffsave turns 3-band float LAB into 8-bit, eg.:
|
I think (?) this is done now, I'll close. |
Hi!
While using the C interface I came to an strange behaviour, when resizing an image with a text (it's a LAB file with black text inside) it generates a bigger image, but with the insides of the text filled with random pixels.
It doesn't happen only when using nearest or linear interpolator, on the others, the image is corrupted.
I have taken a look at the interpolators, and it's a little difficult for me understanding the behaviour to fix it.
I have tested it on macOS Mojave, using libvips homebrew commandline:
The command lines I used:
Here it is attached the two original files, and the output of the command
vips_resize_corruption.zip
If using the 16bit LAB image, the output image gets the text corrupted, and the 8bit one, can't be opened in Photoshop, it says the TIFF file uses an unsupported bit depth.
This is a screenshot of how Photoshop shows the 16bit output image:
EDIT: I tested the 8bit image converted to RGB and it's working correctly.
The text was updated successfully, but these errors were encountered: