Nominate our 2022 Qt Champions!

QColorMap: Pseudo colors with Qt

  • Hello,
    i want to apply "false colors" or "pseudo colors" onto a grayscale QImage but i didn't find any adequate way to do this...? Is there any support apart from writing a native QColor vector and change the color for every pixel i paint?

    alt text

    I cannot find any examples for QColorMap

  • Moderators

    I haven tested it but worth a try, since your screenshot lets me assume you anyway want to show max. 256 colors?

    First convert the QImage to QImage::Format_Indexed8 format, then iterate over the image's color-table and replace the colors based on their value with your colors.

  • this is the classical was, but i develop on an embedded device and ask me if there is no other way to directely do this in qt.

  • So after all the Research i have implemented this function yb my own, there is no native Support for pseudo Colors as far i have seen...

Log in to reply