PCT2RGB(1)

πŸ“¦
version 3.4.3 Β· 2 versions
, in epel 9

πŸ’… PCT2RGB πŸ’…

Okay bestie, so this is the pct2rgb page from the GDAL manual, and it's literally about converting an 8bit paletted image to 24bit RGB. That's the whole vibe. Let's get into it πŸŽ€


✨ NAME ✨

pct2rgb β€” convert an 8bit paletted image to 24bit RGB. Periodt. That's the job.


πŸ¦‹ SYNOPSIS πŸ¦‹

pct2rgb.py [-of format] [-b band] [-rgba] source_file dest_file

Like, that's it. Short and iconic πŸ’…


🌸 DESCRIPTION 🌸

So basically this utility will convert a pseudo-color band on the input file into an output RGB file of the desired format. The way that it just... takes your pseudo-color band and gives you RGB. Slay πŸ”₯


πŸŽ€ OPTIONS πŸŽ€

  • -of <format> β€” picks the output format, bestie. Starting with GDAL 2.3, if you don't specify it, the format is guessed from the extension (previously was GTiff, just so you know). Use the short format name, 'kay? πŸ’–
  • -b <band> β€” which band to convert to RGB. Defaults to 1. Not me defaulting to band one like it's main character energy πŸ‘‘
  • -rgba β€” generates a RGBA file (instead of a RGB file by default). That extra alpha channel said "let me in" πŸ™ˆ
  • <source_file> β€” the input file. The before picture 🫢
  • <dest_file> β€” the output RGB file that will be created. The glow-up ✨

⚠️ NOTE: pct2rgb.py is a Python script, and will only work if GDAL was built with Python support. No Python support? No script. It's giving consequences, fr fr πŸ’€
πŸ“Œ Also highkey important: the '-expand rgb|rgba' option of gdal_translate obsoletes that utility. So like, there's a newer way. The old way is still here but it's lowkey deprecated by that option, iykyk 😭

🌈 AUTHOR 🌈

Huge shoutout to Frank Warmerdam <warmerdam@pobox.com> and Silke Reimer <silke@intevation.de>. Legends, honestly 🧚


1998-2026


And that's the whole page, bestie! πŸ¦‹ This adorable lil' slice of GDAL docs is dated Jan 08, 2026, and the copyright runs 1998-2026 β€” so yeah, it's been serving paletted-to-RGB realness for a minute. Mwah πŸ’‹πŸŽ€

πŸ“¦ where this page comes from