I have an image which is 6130x5548 pixels
and I want to rescale it so that the longest side is 32768 pixels
(and then do a pyramid of tiles with 7 zoom levels). I undestand vips resize
is the obvious way for something like that, hence I tried the line below
vips resize image_in.tif img_rescaled.tif 5.345513866231648
The number 5.34551
is just the ratio 32768/6130
, the scale factor along my x axis
. If I want to specify the exact dimensions in pixels of the retured image how can I do that please?
I tried to use vips thumbnail
for this purpose, I dont know if this is recommended or not but it does work.
vips thumbnail image_in.tif img_rescaled.tif 32768
Is something like that ok please?
Also the two approaches give quite different outputs in terms of MB size. While vips thumbnail
produces a tif
with size 2.8Gb
the vips resize
call returns a tif
with size 1.8Gb
.
Both images have (obviously) the same dimensions 32768x29657 pixels
, same resolution 72dpi
but different bit depth
The tif
from vips thumbnail
has 24 bit depth
whereas the one from vips resize
16 bit depth
. The original image has bit depth=16
.
Also, I understand that the algorithm used by vips translate
plays a significant role to the resulting file size. Can I set the algorithm when I use vips thumbnail
and/or the bit depth
please?