Questions tagged [qimage]

A QImage is a class from the Qt toolkit which provides a hardware-independent image representation that allows direct access to the pixel data, and can be used as a paint device.

Qt provides four classes for handling image data: QImage, QPixmap, QBitmap and QPicture. QImage is designed and optimized for I/O, and for direct pixel access and manipulation.

Because QImage is a QPaintDevice subclass, QPainter can be used to draw directly onto images. When using QPainter on a QImage, the painting can be performed in another thread than the current GUI thread.

The QImage class supports several image formats, including monochrome, 8-bit, 32-bit and alpha-blended images.

QImage provides a collection of functions that can be used to obtain a variety of information about the image. There are also several functions that enable transformation of the image.

QImage objects can be passed around by value since the QImage class uses implicit data sharing. QImage objects can also be streamed and compared.

The official Qt documentation can be found here for Qt 4.8 and here for Qt 5.

549 questions
6
votes
2 answers

how to merge two images into one using QImage and QPainter in qt?

Hi I am developing a blackberry10 app. Inside the app I have two images and I just need to merge these two images into a single image. There is no function in Cascades to combine them. When I posted this in the blackberry developer forum I was…
user2100249
  • 61
  • 1
  • 1
  • 2
6
votes
2 answers

Blending two different images in Qt

My program generate 3 different images and I'd like to combine them using some opacity settings. First I have the raw image, which I already converted into a QPixmap to display it in a QGraphicsView. . Then with this image I make some calculation…
Leo
  • 1,129
  • 4
  • 23
  • 38
5
votes
4 answers

Shifting the hue of a QImage / QPixmap

I suppose this is more of a graphics manipulation question in general, but I'd like to accomplish this in Qt (c++). If I have an image - let's just say a circle on a transparent background - of a light gray color, is there any built-in functionality…
dajaffe
  • 855
  • 13
  • 34
5
votes
2 answers

Generating textual images using QImage (qt)

I am trying to create images from text using QImage. As per the documentation here: http://doc.qt.io/qt-5/qimage.html#Format-enum We cannot use QImage::Format_Indexed8 with QImage. I cannot use QImage::Format_Mono or QImage::Format_MonoLSB due to…
5
votes
2 answers

Qt QImage shows wrong grayscale image

I want to visualize a matrix of integer values between 0 and 255 as a gray-scale image in Qt 5.12. First, I built a sample 256x256 uchar array with values between 0 and 255 in each row. then I tried to show the image with QImage and format_grayscale…
Moh
  • 53
  • 2
5
votes
1 answer

PyQt5 - Add image in background of MainWindow layout

New to PyQt5... Here is a very basic question. I would like to add an image inside the layout of a widget. This widget is the Main Window / root widget of my application. I use the following code, but I get an error message. import sys from…
martin_0004
  • 357
  • 1
  • 2
  • 15
5
votes
1 answer

Need to draw Transparent qimage that includes drawing of a circle using Qt

I am trying to draw a transparent image using QImage but everytime it gives black background. I have a image background,on that I want to draw a circle which should be trasparent(with no background).How can I do that? I have used this code QImage…
5
votes
1 answer

Qt does not load JPG , just PNG

I work with my colleagues on the same project on Windows 7 64 bit version, Visual Studio 2008. They load JPG and they work. Through QPixmap and Stylesheets. And works. But for me, i can only work with PNG, the rest don´t work at all. I also tried…
Darkgaze
  • 2,280
  • 6
  • 36
  • 59
5
votes
3 answers

Problems with large QImage

I'm pretty new to C++/Qt and I'm trying to create an application with Visual Studio C++ and Qt (4.8.3). The application displays images using a QGraphicsView, I need to change the images at pixel level. The basic code is (simplified): QImage* img =…
David Günzel
  • 73
  • 1
  • 4
5
votes
1 answer

High performance QImage output to display

I'm trying to make video output (sequence of frames) to any qt visible widget. At beginning i thought that QLabel will be enough for this point... but i was wrong. Converting to pixmap is too overloading for processor at large images: 1080p for…
DEgITx
  • 960
  • 1
  • 13
  • 24
4
votes
2 answers

Qt: the fastest merging and displaying of images

I'm looking for the fastest way of: merging (it means making one image from couple of images, putting one on other with respect to their alpha values) display images in Qt. This is my…
mkk
  • 675
  • 6
  • 17
4
votes
1 answer

Qt / C++ - Converting raw binary data and display it as an image (i.e. QImage)

I have a C++ Open GL application that renders an animation display, and captures the frame-buffer contents using glReadPixels(), which is then stored as a 1D char array. I can get the buffer contents and save it to a char array, as follow: char *…
all_by_grace
  • 2,315
  • 6
  • 37
  • 52
4
votes
1 answer

How can I decrease the amount of time it takes to save a png using QImage?

Using Qt 4.8rc1, I have a QImage that I want to convert to a png file. It seems like it is taking longer than it should to convert to png format: ~70ms for an 800x800 empty png. Is there a way I can make this more efficient, or am I just…
Michael Nutt
  • 178
  • 1
  • 8
4
votes
2 answers

Fast image manipulation

I have an array 10X10 with values between 1 to 10. Now say I want to give each value a unique color (Say 1 gets blue 2 gets red etc). I'm using qt qimage to represent the image. Here's what I'm doing read array from disk. store in a[10][10] generate…
sleeping.ninja
  • 607
  • 1
  • 10
  • 21
4
votes
1 answer

How to convert a QPixmap's image into a bytes

I want to take an image's data from a QLabel and then store it into a PostgreSQL Database, but I cannot store it as QPixmap, first I need to convert it into a bytes. That's what I want to know. I've read part of the pyqt5's doc, specially the…
1 2
3
36 37