PCT2RGB(1)
π 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 wasGTiff, just so you know). Use the short format name, 'kay? π-b <band>β which band to convert to RGB. Defaults to1. 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 ofgdal_translateobsoletes 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 π§
π COPYRIGHT π
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
- epel 9: gdal3.4-python-tools 3.4.3-5.el9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms