gdal_translate

Convert raster data between different formats. More information: <https://gdal.org/programs/gdal_translate>.

Install

All systems
curl cmd.cat/gdal_translate.sh
Debian Debian
apt-get install gdal-bin
Ubuntu
apt-get install gdal-bin
Arch Arch Linux
pacman -S gdal
image/svg+xml Kali Linux
apt-get install gdal-bin
Fedora
dnf install gdal
Windows (WSL2)
sudo apt-get update sudo apt-get install gdal-bin
OS X
brew install gdal
Raspbian
apt-get install gdal-bin

Convert raster data between different formats. More information: <https://gdal.org/programs/gdal_translate>.

  • Convert a raster dataset to JPEG format:
    gdal_translate -of JPEG path/to/input.tif path/to/output.jpeg
  • Assign a projection to a raster dataset:
    gdal_translate -a_srs EPSG:4326 path/to/input.tif path/to/output.tif
  • Reduce the size of a raster dataset to a specific fraction:
    gdal_translate -outsize 40% 40% path/to/input.tif path/to/output.tif
  • Convert a GeoTiff to a Cloud Optimized GeoTiff:
    gdal_translate path/to/input.tif path/to/output.tif -of COG -co COMPRESS=LZW

© tl;dr; authors and contributors