[gdal-dev] Non able to manage properly vitual file, warping and black edges

Even Rouault even.rouault at spatialys.com
Tue Jan 23 04:00:14 PST 2024


>
> But I need another piece of advice.
> Using alpha transparency, with the 4 bands, I cannot use 
> PHOTOMETRIC=YCBCR, and I used PHOTOMETRIC=RGB.
> This way the compression is a little less effective.
>
> Is there anything comparable, in terms of compression effectiveness, 
> when using alpha transparency and JPEG compression?
> Should I change the type of compression?

require to create a mask band from the 4th band of the input by changing 
-b 4 to -mask 4, removing -co ALPHA=YES, and then you can ask YCbCr

gdal_translate -b 1 -b 2 -b 3 -mask 4 -co BIGTIFF=YES -co COMPRESS=JPEG 
-co PHOTOMETRIC=YCBCR -co JPEG_QUALITY=75 -co TILED=YES -co 
NUM_THREADS=ALL_CPUS warp.vrt output.tif

Note: if you use the COG driver it will do that automatically for you:

gdal_translate -of COG -co BIGTIFF=YES -co COMPRESS=JPEG -co 
NUM_THREADS=ALL_CPUS warp.vrt output.tif

>
> Thank you,
>
> Andrea
>
>
>
> -- 
> ___________________
>
> Andrea Borruso
> website: https://medium.com/tantotanto
> 38° 7' 48" N, 13° 21' 9" E, EPSG:4326
> ___________________
>
> "cercare e saper riconoscere chi e cosa,
>  in mezzo all’inferno, non è inferno,
> e farlo durare, e dargli spazio"
>
> Italo Calvino

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240123/0ef12c0c/attachment.htm>


More information about the gdal-dev mailing list