qimage

QT QImage pixel manipulation problems

Hi. I'm currently in the process of writing a steganography application with QT. I am trying to hide my message bits in the least significant bit of the blue colour of the pixel From debugging I can tell that this section is working as it should. However after hiding my bits in the message I then save the image and then reopen it. Thi...

Enabling JPEG support for QImage in py2exe-compiled Python scripts?

Hello, I'm trying to use a JPEG image in a QImage object from a Python script, with PyQt4. The script itself works perfectly, the image loads and can be manipulated and rendered and all. However, when I try to "compile" (compyle?) this script with py2exe, everything works but the JPEG image. Replacing it with a PNG equivalent works, but...

PyQt4 - Image Watermark

I'm trying to open a PNG image and write some text to it (a watermark) via QImage and QPainter. The code works 100% on Linux but when I run it on Windows XP (haven't tested with any other versions of Windows) the text is never written to the image. I have the code in a try/except block, but no errors are returned. image = QtGui.QImage('...

Painting Issue on QWidget outsite GUI thread

I am developing an appliation in which I want to continuously receive images from remote host and display them on my screen. for this I am following the given strategy 1) I have a main QWidget object which contains the QImage on it (works fine) 2) Images received from remote host are painted on QImage object, this work is done in a worke...

Qt: QImage always saves transparent color as black.

How do I save a file with transparency to a JPEG file without Qt making the transparent color black? I know JPEG doesn't support alpha, and the black is probably just a default "0" value for alpha, but black is a horrible default color. It seems like this should be a simple operation, but all of the mask and alpha functions I've tried a...

How to solve QPixmap::fromImage memory leak?

Hello everyone! I have a problem with Qt. Here is a part of code that troubles me: void FullScreenImage::QImageIplImageCvt(IplImage *input) { help=cvCreateImage(cvGetSize(input), input->depth, input->nChannels); cvCvtColor(input, help, CV_BGR2RGB); QImage tmp((uchar *)help->imageData, help->width, help->height, help->w...

Is QImage able to open and render pure 16-bit images?

I think the headline already explains what I want to know. Is there a possible way to open and save images with 16-bit with Qt? And I don't mean the 3*8=24bit or 4*8=32bit, what is quite the same as a pure 8-bit image, I mean pure 16-bit for R, G and B. ...

How to check if file is/isn't an image without loading full file? Is there an image header-reading library?

edit: Sorry, I guess my question was vague. I'd like to have a way to check if a file is not an image without wasting time loading the whole image, because then I can do the rest of the loading later. I don't want to just check the file extension. The application just views the images. By 'checking the validity', I meant 'detecting and...

JPEG load funcion fails

i am new to linux and qt.I am trying some tutorials.I wrote a simple t application to read jpeg image using QImage.But it is unable to load image.I have modified .pro file to QTPLUGIN += qjpeg LIBS += -ljpeg and when i try to add in file containing main function it gives compilation erors so i droped it and compiled and run the applicat...

QImage from datastream

I'm using the Qt library, creating QImages. I'm able to use this constructor: QImage image("example.jpg"); But I'm having trouble with this static function: char buffer[sizeOfFile]; ifstream inFile("example.jpg"); inFile.read(buffer, sizeOfFile); QImage image = QImage::fromData(buffer); // error here // but there's nothing wrong wit...

Qt image format plugins

Can somebody point me to sites with not supported by Qt image format plugins (reading/writing). XCF and PSD for example. ...

QGraphicsView scrolling and image scaling/cropping

I would like to have a background image in my QGraphicsView that is always scaled (and cropped if necessary) to the size of the viewport, without scrollbars and without scrolling with the keyboard and mouse. The example below is what I am doing to scale and crop an image in the viewport, but I am using random values for the cropping that...

RubyQT QGraphicsview scale images to fit window

I'm trying to make an image scale inside of a QGraphicsView and having zero success. I did find this C++ question with what seemed to be the same problem:http://stackoverflow.com/questions/2489754/qgraphicsview-scrolling-and-image-scaling-cropping I borrowed the approach of overriding the drawback/foreground. However when I run the scr...

QT- QImage and multi-threading problem.

Greetings all, Please refer to image at : http://i48.tinypic.com/316qb78.jpg We are developing an application to extract cell edges from MRC images from electron microscope. MRC file format stores volumetric pixel data (http://en.wikipedia.org/wiki/Voxel) and we simply use 3D char array(char***) to load and store data (gray scale valu...

Very big QImage and Memory Mapped Files in QT

I want bind QImage to the MMF file to manipulate the image without the cost of memory directly on the disc. Unfortunately, my code creates a copy in memory. QFile file("Boston City Flow.jpg"); if(!file.open(QIODevice::ReadOnly)) QMessageBox::information(this, "Error", "Error"); qint64 size = file.size(); unsigned char *mmf = fil...

Qt - QImage is there a method to paste Qimage into another Qimage?

I am looking for a way to simply paste some Qimage into bigger one, starting with some given (x,y). Now, I am copying pixel by pixel all Qimage. ...

Converting an image to text

Hey everyone, I want to be able to save an image as text in a xml file and I can't manage to find a efficient way to do it ! So far I tried : QByteArray ImageAsByteArray; QBuffer ImageBuffer(&ImageAsByteArray); ImageBuffer.open(QIODevice::WriteOnly); rImage.save(&ImageBuffer, "PNG"); return QString(ImageAsByteArray.toBase64()); D...

QImage file path

I don't see this in the documentation anywhere, so it probably doesn't exist, but just in case: I have a function that accepts as a parameter a vector of QImages. Each QImage was loaded from disk at some point and has not been edited--it is just read from. Ideally what I'd like to do is loop over all the QImages and output a list of the...

Constructing QImage from unsigned char* data

I encountered a problem with passing Image object (captured with Point Grej FlyCapture2 SDK) to QImage object. I am getting a pointer associated with Image data by function: virtual unsigned char* FlyCapture2::GetData ( ) and then loading the data by: QImage::QImage ( uchar * data, int width, int height, int bytesPerLine, Format ...