QImage image("image.jpg"); QImage newImage = image.convertToFormat(QImage::Format_RGB32);
QImage image("image.jpg"); int depth = image.depth(); std::cout << "Image depth is: " << depth << " bits per pixel." << std::endl;Both examples use QImage, a class from the Qt library, to manipulate image data.