Unexpected behavior using libvips 8.13 applying filter to image and saving as AV1 #3087
Replies: 4 comments 12 replies
-
Did you see the new https://www.libvips.org/API/current/VipsForeignSave.html#vips-heifsave |
Beta Was this translation helpful? Give feedback.
-
Hi, yes As a workaround, you can add this just after the {
VipsImage *x;
if (vips_cast_uchar(filter_matrix, &x, NULL))
vips_error_exit(NULL);
g_object_unref (filter_matrix);
filter_matrix = x;
} heifsave should probably not save all float images as HDR. Maybe we should only enable this for images tagged as scRGB (which do use 0-1 for black to white)? |
Beta Was this translation helpful? Give feedback.
-
I improved the rules it uses for 16-bit heifsave: fbef674 These now parallel the ones it uses for PNG save, so it should be more consistent. This will be in 8.13.3. Thanks for reporting this @johntrunc ! |
Beta Was this translation helpful? Give feedback.
-
You probably know, but your test prog could be simplified a little. These lines: if (vips_jpegload("example.jpeg", &in,
if (vips_thumbnail_image(in, &thumbnail, 500, Would be better as: if (vips_thumbnail("example.jpeg", &thumbnail, 500, ... You'll see better performance and lower memory use from doing the autorotate later. You can skip the This line: double matrix_array[] = {
0.3588, 0.7044, 0.1368,
0.2990, 0.5870, 0.1140,
0.2392, 0.4696, 0.0912
};
matrix = vips_image_matrix_from_array(3, 3, matrix_array, 9); Could be: matrix = vips_image_new_matrixv(3, 3, {
0.3588, 0.7044, 0.1368,
0.2990, 0.5870, 0.1140,
0.2392, 0.4696, 0.0912
}); Instead of: double alpha[] = {220.0};
if (vips_bandjoin_const(filter_matrix, &filter_matrix_alpha, alpha, 1, NULL)... You could write: if (vips_bandjoin_const1(filter_matrix, &filter_matrix_alpha, 220, NULL)... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have found another unexpected behavior for libvips 8.13 compared to previous 8.12 version.
For the following example I'm trying to thumbnail a jpeg and apply a filter with some alpha, after that saving the image as heif with AV1 compression.
The result with version 8.12 is the expected one (some kind of sepia filtered image) but the same code working with version 8.13 is resulting in a white image:
You can download the used
example.jpeg
image here if needed.Executing the script on version 8.13 and replacing the
vips_heifsave
call with avips_jpegsave
is working fine so I guess is something specific of a side effect of one of the operations that I'm doing and the call tovips_heifsave
function for libvips 8.13.Not sure if this is a bug or not but it is working perfectly on version 8.12, so maybe something changed on version 8.13 that is affecting some of the operations done in the program and causing the unexpected final white image.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions